[add] 新增萤石摄像头抓拍相关逻辑,获取方阵内光伏板、桩点支柱立架、箱变、逆变器地理信息接口
This commit is contained in:
@ -157,6 +157,20 @@ const handleDelete = async (row?: ConstructionBlacklistVO) => {
|
||||
await getList();
|
||||
};
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
getList();
|
||||
}
|
||||
);
|
||||
|
||||
onUnmounted(() => {
|
||||
listeningProject();
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
|
@ -1,50 +1,138 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-descriptions v-loading="loading" title="用户信息" direction="vertical" border>
|
||||
<el-descriptions-item :rowspan="3" :width="200" label="人脸照">
|
||||
<el-image :src="userDetail?.facePicUrl" style="width: 150px; height: 150px" />
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="姓名">{{ userDetail?.userName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="联系电话">{{ userDetail?.phone }}</el-descriptions-item>
|
||||
<el-descriptions-item label="性别">
|
||||
<dict-tag :options="user_sex_type" :value="userDetail?.sex" />
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="年龄">{{ dayjs().diff(dayjs(userDetail?.sfzBirth), 'year') }}</el-descriptions-item>
|
||||
<el-descriptions-item label="民族">{{ userDetail?.nation }}</el-descriptions-item>
|
||||
<el-descriptions-item label="籍贯">{{ userDetail?.nativePlace }}</el-descriptions-item>
|
||||
<el-descriptions-item label="身份证号码">{{ userDetail?.sfzNumber }}</el-descriptions-item>
|
||||
<el-descriptions-item label="身份证有效期">
|
||||
{{ dayjs(userDetail?.sfzStart).format('YYYY 年 MM 月 DD 日') }}
|
||||
—— {{ dayjs(userDetail?.sfzEnd).format('YYYY 年 MM 月 DD 日') }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="身份证地址">{{ userDetail?.sfzSite }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<br />
|
||||
<el-descriptions v-loading="loading" title="银行卡" direction="vertical" border>
|
||||
<el-descriptions-item label="银行卡号">{{ userDetail?.yhkNumber }}</el-descriptions-item>
|
||||
<el-descriptions-item label="银行开户行">{{ userDetail?.yhkOpeningBank }}</el-descriptions-item>
|
||||
<el-descriptions-item label="持卡人">{{ userDetail?.yhkCardholder }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<br />
|
||||
<el-descriptions v-loading="loading" title="单位信息" direction="vertical" border>
|
||||
<el-descriptions-item label="施工单位">{{ userDetail?.contractorVo?.name }}</el-descriptions-item>
|
||||
<el-descriptions-item label="工种">
|
||||
<dict-tag :options="type_of_work" :value="userDetail?.typeOfWork" />
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<br />
|
||||
<el-descriptions :column="2" v-loading="loading" title="其他信息" direction="vertical" border>
|
||||
<el-descriptions-item label="班组">{{ userDetail?.teamVo?.teamName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="打卡状态">
|
||||
<dict-tag :options="user_clock_type" :value="userDetail?.clock" />
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="入场时间">
|
||||
{{ userDetail?.entryDate ? dayjs(userDetail?.entryDate).format('YYYY 年 MM 月 DD 日 HH:mm:ss') : '' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="离场时间">
|
||||
{{ userDetail?.leaveDate ? dayjs(userDetail?.leaveDate).format('YYYY 年 MM 月 DD 日 HH:mm:ss') : '' }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<div class="block_box">
|
||||
<span>用户信息</span>
|
||||
<el-form label-width="130px">
|
||||
<el-row :gutter="20" justify="space-around">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="人脸照">
|
||||
<el-image :src="userDetail?.facePicUrl" style="width: 150px; height: 150px" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="姓名">
|
||||
{{ userDetail?.userName }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="联系电话">
|
||||
{{ userDetail?.phone }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="性别">
|
||||
<dict-tag :options="user_sex_type" :value="userDetail?.sex" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="年龄">
|
||||
{{ dayjs().diff(dayjs(userDetail?.sfzBirth), 'year') }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="民族">
|
||||
{{ userDetail?.nation }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="籍贯">
|
||||
{{ userDetail?.nativePlace }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="身份证号码">
|
||||
{{ userDetail?.sfzNumber }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="身份证号码">
|
||||
{{ userDetail?.sfzNumber }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="身份证有效开始期">
|
||||
{{ dayjs(userDetail?.sfzStart).format('YYYY 年 MM 月 DD 日') }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="身份证有效结束期">
|
||||
{{ dayjs(userDetail?.sfzEnd).format('YYYY 年 MM 月 DD 日') }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="身份证地址">
|
||||
{{ userDetail?.sfzSite }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="block_box">
|
||||
<span>银行卡</span>
|
||||
<el-form label-width="130px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="银行卡号">
|
||||
{{ userDetail?.yhkNumber }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="银行开户行">
|
||||
{{ userDetail?.yhkOpeningBank }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="持卡人">
|
||||
{{ userDetail?.yhkCardholder }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="block_box">
|
||||
<span>单位信息</span>
|
||||
<el-form label-width="130px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="施工单位">
|
||||
{{ userDetail?.contractorVo?.name }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="工种">
|
||||
<dict-tag :options="type_of_work" :value="userDetail?.typeOfWork" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="block_box">
|
||||
<span>其他信息</span>
|
||||
<el-form label-width="130px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="班组">
|
||||
{{ userDetail?.teamVo?.teamName }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="打卡状态">
|
||||
<dict-tag :options="user_clock_type" :value="userDetail?.clock" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="入场时间">
|
||||
{{ userDetail?.entryDate ? dayjs(userDetail?.entryDate).format('YYYY 年 MM 月 DD 日 HH:mm:ss') : '' }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="离场时间">
|
||||
{{ userDetail?.leaveDate ? dayjs(userDetail?.leaveDate).format('YYYY 年 MM 月 DD 日 HH:mm:ss') : '' }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -85,3 +173,16 @@ watch(
|
||||
}
|
||||
);
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.block_box {
|
||||
border: 1px solid #9eccfa;
|
||||
border-radius: 6px;
|
||||
padding: 10px 20px 20px 10px;
|
||||
margin: 15px;
|
||||
> span {
|
||||
color: #409eff;
|
||||
font-weight: 700;
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@ -8,22 +8,22 @@
|
||||
<el-input v-model="queryParams.userName" placeholder="请输入人员姓名" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="分包公司" prop="contractorId">
|
||||
<el-select v-model="queryParams.contractorId" clearable placeholder="请选择分包公司">
|
||||
<el-select v-model="queryParams.contractorId" clearable placeholder="全部">
|
||||
<el-option v-for="item in contractorOpt" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="班组" prop="contractorId">
|
||||
<el-select v-model="queryParams.teamId" clearable placeholder="请选择班组">
|
||||
<el-option v-for="item in projectTeamOpt" :key="item.value" :label="item.label" :value="item.value" />
|
||||
<el-form-item label="班组" prop="teamId">
|
||||
<el-select v-model="queryParams.teamId" clearable placeholder="全部">
|
||||
<el-option v-for="item in ProjectTeam" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="工种" prop="typeOfWork">
|
||||
<el-select v-model="queryParams.typeOfWork" clearable placeholder="请选择工种">
|
||||
<el-select v-model="queryParams.typeOfWork" clearable placeholder="全部">
|
||||
<el-option v-for="item in type_of_work" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="打卡" prop="clock">
|
||||
<el-select v-model="queryParams.clock" clearable placeholder="请选择打卡">
|
||||
<el-select v-model="queryParams.clock" clearable placeholder="全部">
|
||||
<el-option v-for="item in user_clock_type" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@ -62,6 +62,42 @@
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['project: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-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-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">下载资料模板 </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">导入员工资料 </el-button>
|
||||
</file-upload>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
@ -69,7 +105,11 @@
|
||||
<el-table v-loading="loading" :data="constructionUserList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="序号" type="index" width="60" align="center" />
|
||||
<el-table-column label="姓名" align="center" prop="userName" />
|
||||
<el-table-column label="姓名" align="center" prop="userName">
|
||||
<template #default="scope">
|
||||
<el-link type="primary" @click="handleUpdate(scope.row)">{{ scope.row.userName }}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="分包公司" align="center" prop="contractorVo.name" />
|
||||
<el-table-column label="班组" align="center" prop="teamId">
|
||||
<template #default="scope">
|
||||
@ -91,12 +131,31 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="打卡状态" align="center" prop="clock">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="user_clock_type" :value="scope.row.clock" />
|
||||
<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">
|
||||
<template #default="scope">
|
||||
<span class="flex justify-center">
|
||||
{{ 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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="入场时间" align="center" prop="entryDate" min-width="180" />
|
||||
<el-table-column label="离场时间" align="center" prop="leaveDate" min-width="180" />
|
||||
<el-table-column label="薪水" align="center" prop="salary" />
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<template #default="scope">
|
||||
{{ scope.row.status == 0 ? '在职' : '离职' }}
|
||||
@ -112,12 +171,21 @@
|
||||
<el-button link type="success" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['project: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="['project: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="ChatLineSquare" @click="handleExit(scope.row)"> 入退场记录 </el-button>
|
||||
<el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['project: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-button link type="primary" icon="FolderAdd" @click="handleUpload(scope.row)">文件上传 </el-button>
|
||||
</el-badge>
|
||||
</el-tooltip>
|
||||
</el-space>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -132,7 +200,7 @@
|
||||
<div class="msg">用户信息</div>
|
||||
<div class="el-row">
|
||||
<div class="el-col el-col-24">
|
||||
<el-form-item label="人脸照" prop="pacePhoto">
|
||||
<el-form-item label="人脸照" prop="facePic">
|
||||
<image-upload v-model="form.facePic" :limit="1" :is-show-tip="false" />
|
||||
</el-form-item>
|
||||
</div>
|
||||
@ -247,6 +315,13 @@
|
||||
</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-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class="el-col el-col-12">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" style="width: 240px" />
|
||||
@ -262,9 +337,128 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<el-dialog title="施工人员详情" v-model="showDetailDrawer">
|
||||
<el-dialog title="施工人员详情" v-model="showDetailDrawer" width="800px">
|
||||
<construction-user-detail :user-id="currentUserId" />
|
||||
</el-dialog>
|
||||
<el-dialog :title="skipName + '-人员迁移'" v-model="skip" width="500px">
|
||||
<el-form-item label="所属项目" label-width="130px">
|
||||
<el-select v-model="skipObject.projectId" @change="selectProject" placeholder="请选择所属项目" style="width: 240px">
|
||||
<el-option v-for="item in skipOptions" :key="item.id" :label="item.projectName" :value="item.id" />
|
||||
</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-option v-for="item in contractorList" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="setUnits">确认</el-button>
|
||||
<el-button @click="skip = false"> 取消 </el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<el-dialog title="上传文件" v-model="fileStatus" width="770px">
|
||||
<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" />
|
||||
</div>
|
||||
</div>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="updateProjectFile">确认</el-button>
|
||||
<el-button @click="fileStatus = false"> 取消 </el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<el-dialog :title="skipName + '-切换人脸'" v-model="showFaceDrawer" width="770px">
|
||||
<div class="flex items-center justify-center">
|
||||
<el-form :model="form" ref="constructionUserFormRef" :rules="rules">
|
||||
<el-form-item>
|
||||
<image-upload v-model="form.facePic" :limit="1" :is-show-tip="false" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<template #footer>
|
||||
<span
|
||||
><el-button type="primary" @click="submitForm">保存</el-button>
|
||||
<el-button @click="showFaceDrawer = false">取消</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<el-dialog title="修改在职状态" v-model="statusDialog" width="30%">
|
||||
<el-form-item label="在职状态">
|
||||
<el-select v-model="vocationalStatus" placeholder="请选择状态">
|
||||
<el-option v-for="item in user_status_type" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<template #footer>
|
||||
<span
|
||||
><el-button type="primary" @click="handleEdit">保存</el-button>
|
||||
<el-button @click="statusDialog = false">取消</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<el-dialog title="温馨提示" v-model="salaryStatus" width="30%">
|
||||
<span>请输入薪资</span>
|
||||
<el-input class="mt-xl" v-model="changeSalary" placeholder="" clearable @change=""></el-input>
|
||||
<template #footer>
|
||||
<span>
|
||||
<el-button type="primary" @click="handleSalary">确认</el-button>
|
||||
<el-button @click="salaryStatus = false">取消</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<el-dialog title="入场退场记录" v-model="exitStatus" width="600px">
|
||||
<div v-for="(item, index) in exitList">
|
||||
<el-timeline>
|
||||
<el-timeline-item color="#0bbd87" class="mb">
|
||||
{{ '入场时间:' + item.entryDate }}
|
||||
</el-timeline-item>
|
||||
<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 />
|
||||
<p class="mt text-coolgray">
|
||||
备注:<span class="text-blue">{{ item.remark }}</span>
|
||||
</p>
|
||||
</div>
|
||||
</el-timeline-item>
|
||||
</el-timeline>
|
||||
</div>
|
||||
|
||||
<template #footer>
|
||||
<span>
|
||||
<el-button @click="exitStatus = false">关闭</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<el-dialog :title="`打卡记录`" v-model="playCardCalendar" width="770px" :close-on-click-modal="false">
|
||||
<el-calendar ref="calendar" v-model="calendarDay">
|
||||
<template #header="{ date }">
|
||||
<span>{{ date }}</span>
|
||||
<div class="status-detail flex items-center justify-between">
|
||||
<div class="green">全天考勤正常</div>
|
||||
<div class="orange">半勤</div>
|
||||
<div class="red">缺卡</div>
|
||||
<div class="gray">请假</div>
|
||||
</div>
|
||||
<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)"
|
||||
>
|
||||
{{ data.day.split('-').slice(1).join('-') }}
|
||||
<div :style="{ background: playCardColor(data) }" v-if="playCardIdx(data) != -1"></div>
|
||||
</div>
|
||||
</template>
|
||||
</el-calendar>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -274,9 +468,26 @@ import {
|
||||
delConstructionUser,
|
||||
getConstructionUser,
|
||||
listConstructionUser,
|
||||
updateConstructionUser
|
||||
updateConstructionUser,
|
||||
getProjectContractorList,
|
||||
transferConstructionUser,
|
||||
updateConstructionUserStatus,
|
||||
updateConstructionUserPlayCardStatus,
|
||||
updateConstructionUserPlayCardOneStatus,
|
||||
updateConstructionUserSalary,
|
||||
getConstructionUserExit,
|
||||
dowloadConstructionUserTemplate,
|
||||
importConstructionUserInfo,
|
||||
listConstructionMonth
|
||||
} from '@/api/project/constructionUser';
|
||||
import { ConstructionUserForm, ConstructionUserQuery, ConstructionUserVO } from '@/api/project/constructionUser/types';
|
||||
import {
|
||||
ConstructionUserForm,
|
||||
ConstructionUserQuery,
|
||||
ConstructionUserVO,
|
||||
skipType,
|
||||
skipOptionType,
|
||||
skipTeamType
|
||||
} from '@/api/project/constructionUser/types';
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
import { listContractor } from '@/api/project/contractor';
|
||||
import { listProjectTeam } from '@/api/project/projectTeam';
|
||||
@ -284,14 +495,28 @@ import { ContractorVO } from '@/api/project/contractor/types';
|
||||
import { ProjectTeamVO } from '@/api/project/projectTeam/types';
|
||||
import ConstructionUserDetail from '@/views/project/constructionUser/component/ConstructionUserDetail.vue';
|
||||
import { addConstructionBlacklist } from '@/api/project/constructionBlacklist';
|
||||
import { listConstructionUserFile, setConstructionUserFile } from '@/api/project/constructionUserFile';
|
||||
import {
|
||||
ConstructionUserFileVO,
|
||||
ConstructionUserExitVO,
|
||||
ConstructionUserFileForm,
|
||||
ConstructionUserFileQuery
|
||||
} from '@/api/project/constructionUserFile/types';
|
||||
import { ElLoadingService } from 'element-plus';
|
||||
import type { CalendarDateType, CalendarInstance } from 'element-plus';
|
||||
import { AttendanceMonthVO } from '@/api/project/attendance/types';
|
||||
import { parseTime } from '@/utils/ruoyi';
|
||||
|
||||
const calendar = ref<CalendarInstance>();
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { type_of_work, user_sex_type, user_clock_type } = toRefs<any>(proxy?.useDict('type_of_work', 'user_sex_type', 'user_clock_type'));
|
||||
|
||||
const { type_of_work, user_sex_type, user_clock_type, user_file_type, user_status_type, wage_measure_unit_type } = toRefs<any>(
|
||||
proxy?.useDict('type_of_work', 'user_sex_type', 'user_clock_type', 'user_file_type', 'user_status_type', 'wage_measure_unit_type')
|
||||
);
|
||||
// 获取用户 store
|
||||
const userStore = useUserStoreHook();
|
||||
// 从 store 中获取项目列表和当前选中的项目
|
||||
const currentProject = computed(() => userStore.selectedProject);
|
||||
const ProjectTeam = computed(() => userStore.ProjectTeamList);
|
||||
const constructionUserList = ref<ConstructionUserVO[]>([]);
|
||||
const buttonLoading = ref(false);
|
||||
const loading = ref(true);
|
||||
@ -300,14 +525,42 @@ const ids = ref<Array<string | number>>([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
|
||||
const skip = ref(false);
|
||||
const fileStatus = ref(false);
|
||||
const showFaceDrawer = ref(false);
|
||||
const statusDialog = ref(false);
|
||||
const playCardStatus = ref(false);
|
||||
const playCardLoding = ref(false);
|
||||
const playCardCalendar = ref(false);
|
||||
const salaryStatus = ref(false);
|
||||
const exitStatus = ref(false);
|
||||
const calendarDay = ref<Date | null>(null);
|
||||
const monthValue = ref<Date | null>(null);
|
||||
const informationStatus = ref(false);
|
||||
const filePath = ref<string>('');
|
||||
const exitList = ref<ConstructionUserExitVO[]>([]);
|
||||
const changeSalary = ref<string>('');
|
||||
const vocationalStatus = ref<number>(null);
|
||||
const fileList = ref<ConstructionUserFileVO[]>([]);
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const constructionUserFormRef = ref<ElFormInstance>();
|
||||
|
||||
const skipName = ref('');
|
||||
const calendarList = ref<Array<AttendanceMonthVO>>([]);
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
title: '',
|
||||
id: undefined
|
||||
});
|
||||
const baseUrl = import.meta.env.VITE_APP_BASE_API;
|
||||
//人员迁移条件
|
||||
const skipObject: skipType = reactive({
|
||||
id: '',
|
||||
projectId: '',
|
||||
contractorId: ''
|
||||
});
|
||||
const contractorList = ref<Array<skipTeamType>>([]);
|
||||
//项目列表
|
||||
const skipOptions = ref<Array<skipOptionType>>([]);
|
||||
|
||||
const initFormData: ConstructionUserForm = {
|
||||
id: undefined,
|
||||
@ -328,6 +581,7 @@ const initFormData: ConstructionUserForm = {
|
||||
sfzNumber: undefined,
|
||||
sfzStart: undefined,
|
||||
sfzEnd: undefined,
|
||||
wageMeasureUnit: undefined,
|
||||
sfzSite: undefined,
|
||||
sfzBirth: undefined,
|
||||
nativePlace: undefined,
|
||||
@ -376,13 +630,88 @@ const data = reactive<PageData<ConstructionUserForm, ConstructionUserQuery>>({
|
||||
params: {}
|
||||
},
|
||||
rules: {
|
||||
id: [{ required: true, message: '主键id不能为空', trigger: 'blur' }],
|
||||
clock: [{ required: true, message: '打卡不能为空', trigger: 'blur' }]
|
||||
clock: [{ required: true, message: '打卡不能为空', trigger: 'blur' }],
|
||||
facePic: [{ required: true, message: '人脸照不能为空', trigger: 'blur' }],
|
||||
userName: [{ required: true, message: '人员姓名不能为空', trigger: 'blur' }],
|
||||
projectId: [{ required: true, message: '项目id不能为空', trigger: 'blur' }],
|
||||
contractorId: [{ required: true, message: '分包公司id不能为空', trigger: 'blur' }],
|
||||
teamId: [{ required: true, message: '班组id不能为空', trigger: 'blur' }],
|
||||
phone: [{ required: true, message: '联系电话不能为空', trigger: 'blur' }],
|
||||
nation: [{ required: true, message: '民族不能为空', trigger: 'blur' }],
|
||||
sfzFrontPic: [{ required: true, message: '身份证正面图片不能为空', trigger: 'blur' }],
|
||||
sfzBackPic: [{ required: true, message: '身份证背面图片不能为空', trigger: 'blur' }],
|
||||
sfzNumber: [{ required: true, message: '身份证号码不能为空', trigger: 'blur' }],
|
||||
sfzStart: [{ required: true, message: '身份证有效开始期不能为空', trigger: 'blur' }],
|
||||
sfzEnd: [{ required: true, message: '身份证有效结束期不能为空', trigger: 'blur' }],
|
||||
sfzSite: [{ required: true, message: '身份证地址不能为空', trigger: 'blur' }],
|
||||
sfzBirth: [{ required: true, message: '身份证出生日期不能为空', trigger: 'blur' }],
|
||||
nativePlace: [{ required: true, message: '籍贯不能为空', trigger: 'blur' }],
|
||||
yhkPic: [{ required: true, message: '银行卡图片不能为空', trigger: 'blur' }],
|
||||
yhkNumber: [{ required: true, message: '银行卡号不能为空', trigger: 'blur' }],
|
||||
yhkOpeningBank: [{ required: true, message: '开户行不能为空', trigger: 'blur' }],
|
||||
typeOfWork: [{ required: true, message: '工种(字典type_of_work)不能为空', trigger: 'blur' }],
|
||||
wageMeasureUnit: [{ required: true, message: '工资计量单位不能为空', trigger: 'blur' }],
|
||||
userRole: [{ required: true, message: '用户角色(1=普通用户,2=管理员)不能为空', trigger: 'blur' }]
|
||||
}
|
||||
});
|
||||
|
||||
/** 返回遍历文件对象 */
|
||||
const uploadPath = computed(() => {
|
||||
const list = JSON.parse(JSON.stringify(user_file_type.value));
|
||||
for (const item of fileList.value) {
|
||||
const targetType = item.fileType;
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
if (list[i].value == targetType) {
|
||||
list[i] = { ...list[i], ...item }; // 合并对象
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
if (!list[i].hasOwnProperty('fileType')) {
|
||||
list[i].fileType = list[i].value;
|
||||
}
|
||||
}
|
||||
console.log(list);
|
||||
return list;
|
||||
});
|
||||
|
||||
/** 返回文件上传状态 */
|
||||
const uploadStatusColor = computed(() => (str: string) => {
|
||||
switch (str) {
|
||||
case '3':
|
||||
return 'success';
|
||||
case '2':
|
||||
return 'danger';
|
||||
default:
|
||||
return 'info';
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
//打卡时间下标
|
||||
const playCardIdx = computed(() => (date) => {
|
||||
return calendarList.value.findIndex((item) => item.clockDate == date.day);
|
||||
});
|
||||
|
||||
//打卡状态颜色
|
||||
const playCardColor = computed(() => (date) => {
|
||||
const idx = calendarList.value[playCardIdx.value(date)]?.status;
|
||||
switch (idx) {
|
||||
case '1':
|
||||
return 'green';
|
||||
case '2':
|
||||
return 'orange';
|
||||
case '3':
|
||||
return 'red';
|
||||
case '4':
|
||||
return 'gray';
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
});
|
||||
|
||||
/** 查询施工人员列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
@ -392,6 +721,50 @@ const getList = async () => {
|
||||
loading.value = false;
|
||||
};
|
||||
|
||||
/** 查看打卡记录详情 */
|
||||
const handleViewPlayCard = async (idx: number, data: any) => {
|
||||
if (data.type == 'next-month' || data.type == 'prev-month') {
|
||||
monthValue.value = data.date;
|
||||
handleCalendarMonth(monthValue.value);
|
||||
}
|
||||
|
||||
const statusColor = calendarList.value[idx]?.status;
|
||||
if (idx == -1 || statusColor == '4' || statusColor == '3') {
|
||||
return proxy?.$modal.msgWarning('暂无打卡记录数据');
|
||||
}
|
||||
const { downClockTime, downClockPic, upClockTime, upClockPic } = calendarList.value[idx]?.clockList;
|
||||
ElNotification({
|
||||
title: '温馨提示',
|
||||
dangerouslyUseHTMLString: true,
|
||||
message: `<div style="display: flex;flex-direction: row;align-items: center;margin-top: 15px;height:60px">
|
||||
<span>头像:</span>
|
||||
<div style="width: 50px;height: 50px;border-radius:15px;">
|
||||
<img src="${upClockPic}" style="width: 100%;height: 100%;border-radius:15px;">
|
||||
</div>
|
||||
</div><span>上班打卡时间:${upClockTime ? upClockTime : ''}</span><div style="display: flex;flex-direction: row;align-items: center;margin-top: 15px;height:60px">
|
||||
<span>头像:</span>
|
||||
<div style="width: 50px;height: 50px;border-radius:15px;">
|
||||
<img src="${downClockPic}" style="width: 100%;height: 100%;border-radius:15px;">
|
||||
</div>
|
||||
</div><span>下班打卡时间:${downClockTime ? downClockTime : ''}</span>`
|
||||
});
|
||||
};
|
||||
|
||||
const selectProject = (e: any) => {
|
||||
//选中项目筛选出项目下的分包单位并清空分包单位value
|
||||
contractorList.value = skipOptions.value.filter((item) => item.id == e)[0].contractorList;
|
||||
skipObject.contractorId = '';
|
||||
};
|
||||
|
||||
const setUnits = async () => {
|
||||
//人员迁移
|
||||
let res = await transferConstructionUser(skipObject);
|
||||
if (res.code == 200) {
|
||||
ElMessage.success(res.msg);
|
||||
skip.value = false;
|
||||
getList();
|
||||
}
|
||||
};
|
||||
const contractorOpt = ref();
|
||||
|
||||
/** 查询当前项目下的分包公司列表 */
|
||||
@ -409,27 +782,45 @@ const getContractorList = async () => {
|
||||
loading.value = false;
|
||||
};
|
||||
|
||||
const projectTeamOpt = ref([]);
|
||||
const handleMonth = async (e: any) => {
|
||||
calendarDay.value = e;
|
||||
handleCalendarMonth(e);
|
||||
};
|
||||
|
||||
/** 查询当前项目下的班组列表 */
|
||||
const getProjectTeamList = async () => {
|
||||
loading.value = true;
|
||||
const res = await listProjectTeam({
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
orderByColumn: 'createTime',
|
||||
isAsc: 'desc',
|
||||
projectId: currentProject.value.id
|
||||
const handleCalendarMonth = async (e?) => {
|
||||
let clockMonth;
|
||||
if (e) {
|
||||
clockMonth = parseTime(e, '{y}-{m}');
|
||||
}
|
||||
|
||||
const res = await listConstructionMonth({ userId: dialog.id, clockMonth });
|
||||
calendarList.value = res.data;
|
||||
};
|
||||
|
||||
/** 上传安全协议书按钮操作 */
|
||||
|
||||
const updateProjectFile = async () => {
|
||||
buttonLoading.value = true;
|
||||
let fileList = uploadPath.value.map((item) => {
|
||||
return {
|
||||
fileId: item.path,
|
||||
fileType: item.fileType
|
||||
};
|
||||
});
|
||||
projectTeamOpt.value = res.rows.map((projectTeam: ProjectTeamVO) => ({
|
||||
value: projectTeam.id,
|
||||
label: projectTeam.teamName
|
||||
}));
|
||||
loading.value = false;
|
||||
const data = {
|
||||
userId: currentUserId.value,
|
||||
fileList
|
||||
};
|
||||
console.log('🚀 ~ updateProjectFile ~ data:', data);
|
||||
await setConstructionUserFile(data);
|
||||
proxy?.$modal.msgSuccess('上传成功');
|
||||
buttonLoading.value = false;
|
||||
fileStatus.value = false;
|
||||
await getList();
|
||||
};
|
||||
|
||||
const getTeamName = (teamId: string | number) => {
|
||||
const team = projectTeamOpt.value.find((item: any) => item.value === teamId);
|
||||
const team = ProjectTeam.value.find((item: any) => item.value === teamId);
|
||||
return team ? team.label : teamId;
|
||||
};
|
||||
|
||||
@ -489,11 +880,74 @@ const handleShowDrawer = (row?: ConstructionUserVO) => {
|
||||
showDetailDrawer.value = true;
|
||||
};
|
||||
|
||||
//打卡按钮
|
||||
const handlePlayCard = async (row: ConstructionUserVO) => {
|
||||
const _id = row?.id || ids.value[0];
|
||||
skipName.value = row?.userName;
|
||||
dialog.id = _id;
|
||||
await handleCalendarMonth();
|
||||
|
||||
playCardCalendar.value = true;
|
||||
};
|
||||
|
||||
//下载模板
|
||||
const downloadTemplate = async () => {
|
||||
const loadingInstance = ElLoadingService({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
});
|
||||
const res = await dowloadConstructionUserTemplate({ projectId: currentProject.value.id });
|
||||
loadingInstance.close();
|
||||
};
|
||||
|
||||
//导入资料
|
||||
const importInformation = async () => {};
|
||||
|
||||
/** 人员迁移 */
|
||||
const handleChange = async (row: ConstructionUserVO) => {
|
||||
const _id = row?.id || ids.value[0];
|
||||
skipName.value = row?.userName;
|
||||
skipObject.id = _id;
|
||||
const res = await getProjectContractorList();
|
||||
skipOptions.value = res.data;
|
||||
skip.value = true;
|
||||
};
|
||||
|
||||
// //切换人脸
|
||||
// const handleToggle = async (row: ConstructionUserVO) => {
|
||||
// reset();
|
||||
// skipName.value = row?.userName;
|
||||
// const _id = row?.id || ids.value[0];
|
||||
// const res = await getConstructionUser(_id);
|
||||
// Object.assign(form.value, res.data);
|
||||
// showFaceDrawer.value = true;
|
||||
// };
|
||||
|
||||
const handleExit = async (row: ConstructionUserVO) => {
|
||||
const _id = row?.id || ids.value[0];
|
||||
currentUserId.value = _id;
|
||||
const res = await getConstructionUserExit({ userId: _id });
|
||||
exitList.value = res.rows;
|
||||
exitStatus.value = true;
|
||||
};
|
||||
|
||||
//上传按钮
|
||||
const handleUpload = async (row: ConstructionUserVO) => {
|
||||
const _id = row?.id || ids.value[0];
|
||||
currentUserId.value = _id;
|
||||
const res = await listConstructionUserFile({ userId: _id });
|
||||
fileList.value = res.data;
|
||||
fileStatus.value = true;
|
||||
};
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = () => {
|
||||
constructionUserFormRef.value?.validate(async (valid: boolean) => {
|
||||
console.log(valid);
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
form.value.projectId = currentProject.value.id;
|
||||
if (form.value.id) {
|
||||
await updateConstructionUser(form.value).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
@ -501,7 +955,10 @@ const submitForm = () => {
|
||||
}
|
||||
proxy?.$modal.msgSuccess('操作成功');
|
||||
dialog.visible = false;
|
||||
showFaceDrawer.value = false;
|
||||
await getList();
|
||||
} else {
|
||||
console.log(12);
|
||||
}
|
||||
});
|
||||
};
|
||||
@ -536,14 +993,149 @@ const handleExport = () => {
|
||||
`constructionUser_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
};
|
||||
/** 用户状态编辑操作 */
|
||||
const handleEdit = async () => {
|
||||
if (!vocationalStatus.value) {
|
||||
proxy?.$modal.msgError('请选择状态');
|
||||
return;
|
||||
}
|
||||
const data = {
|
||||
idList: ids.value,
|
||||
status: vocationalStatus.value
|
||||
};
|
||||
await updateConstructionUserStatus(data);
|
||||
proxy?.$modal.msgSuccess('修改成功');
|
||||
getList();
|
||||
ids.value = [];
|
||||
statusDialog.value = false;
|
||||
};
|
||||
|
||||
//打开修改日薪
|
||||
const openSalaryDialog = (row: ConstructionUserVO) => {
|
||||
const _id = row?.id || ids.value[0];
|
||||
currentUserId.value = _id;
|
||||
if (row.salary) {
|
||||
setSalary();
|
||||
return;
|
||||
}
|
||||
console.log(row);
|
||||
salaryStatus.value = true;
|
||||
};
|
||||
|
||||
//变更日薪
|
||||
const handleSalary = async () => {
|
||||
if (!changeSalary.value) {
|
||||
proxy?.$modal.msgError('请输入薪资');
|
||||
return;
|
||||
}
|
||||
setSalary();
|
||||
};
|
||||
const setSalary = async () => {
|
||||
await updateConstructionUserSalary({ id: currentUserId.value, salary: changeSalary.value });
|
||||
proxy?.$modal.msgSuccess('修改成功');
|
||||
getList();
|
||||
changeSalary.value = '';
|
||||
salaryStatus.value = false;
|
||||
};
|
||||
|
||||
// 批量切换在职状态
|
||||
const handlePlayCardStatus = async (e) => {
|
||||
playCardLoding.value = true;
|
||||
const clock = e ? 1 : 0;
|
||||
await updateConstructionUserPlayCardStatus({ projectId: currentProject.value.id, clock });
|
||||
proxy?.$modal.msgSuccess('修改成功');
|
||||
getList();
|
||||
playCardLoding.value = false;
|
||||
};
|
||||
|
||||
// 切换在职状态
|
||||
const handleClockStatus = async (row: ConstructionUserVO) => {
|
||||
playCardLoding.value = true;
|
||||
await updateConstructionUserPlayCardOneStatus({ id: row.id, clock: row.clock });
|
||||
proxy?.$modal.msgSuccess('修改成功');
|
||||
getList();
|
||||
playCardLoding.value = false;
|
||||
};
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
getList();
|
||||
}
|
||||
);
|
||||
|
||||
onUnmounted(() => {
|
||||
listeningProject();
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
getContractorList();
|
||||
getProjectTeamList();
|
||||
});
|
||||
</script>
|
||||
<style scoped>
|
||||
<style scoped lang="scss">
|
||||
.status-detail {
|
||||
margin: 0 15px;
|
||||
position: relative;
|
||||
font-size: 12px;
|
||||
> div {
|
||||
margin: 0 15px;
|
||||
position: relative;
|
||||
font-size: 12px;
|
||||
&::before {
|
||||
position: absolute;
|
||||
content: '';
|
||||
display: inline-block;
|
||||
left: -15px;
|
||||
top: 30%;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
.red {
|
||||
&::before {
|
||||
background-color: red;
|
||||
}
|
||||
}
|
||||
.gray {
|
||||
&::before {
|
||||
background-color: gray;
|
||||
}
|
||||
}
|
||||
.orange {
|
||||
&::before {
|
||||
background-color: orange;
|
||||
}
|
||||
}
|
||||
.green {
|
||||
&::before {
|
||||
background-color: green;
|
||||
}
|
||||
}
|
||||
}
|
||||
.monthDay {
|
||||
padding: 8px;
|
||||
> div {
|
||||
position: absolute;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
border-radius: 50%;
|
||||
bottom: 8px;
|
||||
left: 0;
|
||||
right: 0;
|
||||
margin: auto;
|
||||
}
|
||||
.type2 {
|
||||
background: rgb(255, 0, 0);
|
||||
}
|
||||
.type3 {
|
||||
background: rgb(0, 128, 0);
|
||||
}
|
||||
}
|
||||
.block_box {
|
||||
border: 1px solid #9eccfa;
|
||||
border-radius: 6px;
|
||||
@ -557,4 +1149,27 @@ onMounted(() => {
|
||||
font-size: 14px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.image_upload {
|
||||
border-bottom: 1px solid #e3e3d7;
|
||||
padding-bottom: 4px;
|
||||
}
|
||||
.title {
|
||||
font-size: 18px;
|
||||
font-weight: 700;
|
||||
display: block;
|
||||
margin: 10px 0;
|
||||
width: 100%;
|
||||
font-family: cursive;
|
||||
}
|
||||
.information {
|
||||
display: none;
|
||||
}
|
||||
.informationStatus:hover .information {
|
||||
display: block;
|
||||
}
|
||||
::v-deep(.el-calendar) {
|
||||
.el-calendar-day {
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@ -15,9 +15,10 @@
|
||||
<el-col :span="16">
|
||||
<file-upload
|
||||
v-model="ossIdMap[activeMenu]"
|
||||
:limit="1"
|
||||
:limit="20"
|
||||
:file-size="50"
|
||||
:file-type="['pdf']"
|
||||
isDarg
|
||||
@update:model-value="
|
||||
(args) => {
|
||||
handleOssUpdate(args);
|
||||
|
@ -122,16 +122,6 @@ const contractorFormRef = ref<ElFormInstance>();
|
||||
const userStore = useUserStoreHook();
|
||||
// 从 store 中获取项目列表和当前选中的项目
|
||||
const currentProject = computed(() => userStore.selectedProject);
|
||||
//监听项目改变
|
||||
// watch(
|
||||
// () => currentProject.value,
|
||||
// (newId, oldId) => {
|
||||
// /* ... */
|
||||
// queryParams.value.projectId=newId.id
|
||||
// // getList()
|
||||
|
||||
// }
|
||||
// )
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
@ -145,7 +135,8 @@ const initFormData: ContractorForm = {
|
||||
custodian: undefined,
|
||||
custodianPhone: undefined,
|
||||
fileMap: undefined,
|
||||
remark: undefined
|
||||
remark: undefined,
|
||||
projectId: currentProject.value.id
|
||||
};
|
||||
const data = reactive<PageData<ContractorForm, ContractorQuery>>({
|
||||
form: { ...initFormData },
|
||||
@ -172,7 +163,6 @@ const { queryParams, form, rules } = toRefs(data);
|
||||
/** 查询分包单位列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
|
||||
const res = await listContractor(queryParams.value);
|
||||
contractorList.value = res.rows;
|
||||
total.value = res.total;
|
||||
@ -231,6 +221,7 @@ const handleUpdate = async (row?: ContractorVO) => {
|
||||
const submitForm = () => {
|
||||
contractorFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
form.value.projectId = currentProject.value.id;
|
||||
buttonLoading.value = true;
|
||||
if (form.value.id) {
|
||||
await updateContractor(form.value).finally(() => (buttonLoading.value = false));
|
||||
@ -272,7 +263,20 @@ const handleContractorFile = (row?: ContractorVO) => {
|
||||
console.log(currentContractorId.value);
|
||||
visible.value = true;
|
||||
};
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
console.log('监听项目id', queryParams.value.projectId, form.value.projectId);
|
||||
getList();
|
||||
}
|
||||
);
|
||||
|
||||
onUnmounted(() => {
|
||||
listeningProject();
|
||||
});
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
|
@ -43,35 +43,100 @@
|
||||
</template>
|
||||
|
||||
<el-table v-loading="loading" :data="projectList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="expand" width="50">
|
||||
<template #default="{ row }">
|
||||
<div class="w187.25 ml-12.5">
|
||||
<el-button class="mb" type="primary" size="small" @click="handleOpenSetChild(row.id)" icon="plus">添加子项目</el-button>
|
||||
|
||||
<el-table :data="row.children" border stripe>
|
||||
<el-table-column label="序号" type="index" width="55" align="center" />
|
||||
<el-table-column label="名称" align="center" prop="projectName" width="296" />
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="199" />
|
||||
<el-table-column fixed="right" align="center" label="操作" class-name="small-padding fixed-width" width="199">
|
||||
<template #default="scope">
|
||||
<el-space>
|
||||
<el-button
|
||||
link
|
||||
type="success"
|
||||
icon="Edit"
|
||||
@click="handleOpenSetChild(row.id, scope.row.id, scope.row.projectName)"
|
||||
v-hasPermi="['project:project:edit']"
|
||||
>修改
|
||||
</el-button>
|
||||
<el-button link type="danger" icon="Delete" @click="handleChildDel(scope.row.id)" v-hasPermi="['project:project:remove']"
|
||||
>删除
|
||||
</el-button>
|
||||
</el-space>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="序号" type="index" width="60" align="center" />
|
||||
<el-table-column label="项目名称" align="center" prop="projectName" />
|
||||
<el-table-column label="项目名称" align="center" prop="projectName">
|
||||
<template #default="scope">
|
||||
<el-link
|
||||
:type="scope.row.designId ? 'primary' : 'default'"
|
||||
:disabled="!scope.row.designId"
|
||||
@click="handleOpenLayer(scope.row)"
|
||||
v-loading.fullscreen.lock="fullscreenLoading"
|
||||
>{{ scope.row.projectName }}</el-link
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="项目简称" align="center" prop="shortName" />
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="sys_normal_disable" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="项目类型" align="center" prop="type" />
|
||||
<el-table-column label="项目类别" align="center" prop="isType">
|
||||
<el-table-column label="项目类型" align="center" prop="projectType" width="120">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="project_category_type" :value="scope.row.isType" />
|
||||
<dict-tag :options="project_type" :value="scope.row.projectType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="项目类别" align="center" prop="projectCategory">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="project_category_type" :value="scope.row.projectCategory" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="项目地址" align="center" prop="projectSite" />
|
||||
<el-table-column label="负责人" align="center" prop="principal" />
|
||||
<el-table-column label="负责人电话" align="center" prop="principalPhone" />
|
||||
<el-table-column label="实际容量" align="center" prop="actual" />
|
||||
<el-table-column label="计划容量" align="center" prop="plan" />
|
||||
<el-table-column label="负责人电话" align="center" prop="principalPhone" width="120" />
|
||||
<el-table-column label="实际容量(M)" align="center" prop="actual" width="100" />
|
||||
<el-table-column label="计划容量(M)" align="center" prop="plan" width="100" />
|
||||
<el-table-column label="开工时间" align="center" prop="onStreamTime" width="120" />
|
||||
<el-table-column label="打卡范围" align="center" prop="punchRange" />
|
||||
<el-table-column label="设计总量" align="center" prop="designTotal" />
|
||||
<!-- <el-table-column label="是否上传DXF" align="center" prop="designId" width="140">
|
||||
<template #default="scope">
|
||||
<el-link
|
||||
:type="scope.row.designId ? 'primary' : 'default'"
|
||||
:disabled="!scope.row.designId"
|
||||
@click="handleOpenLayer(scope.row)"
|
||||
v-loading.fullscreen.lock="fullscreenLoading"
|
||||
>{{ scope.row.designId ? '已上传' : '未上传' }}</el-link
|
||||
>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180" />
|
||||
<el-table-column fixed="right" label="操作" align="center" class-name="small-padding fixed-width" width="260">
|
||||
<el-table-column fixed="right" label="操作" align="center" class-name="small-padding fixed-width" width="400">
|
||||
<template #default="scope">
|
||||
<el-space>
|
||||
<el-button link type="primary" icon="FolderOpened" @click="handleShowUpload(scope.row)">导入安全协议书 </el-button>
|
||||
<file-upload
|
||||
:limit="1"
|
||||
:fileSize="200"
|
||||
:fileType="['dxf']"
|
||||
v-model:model-value="dxfFile"
|
||||
uploadUrl="/project/projectFile/upload/dxf"
|
||||
:data="{ projectId: scope.row.id }"
|
||||
>
|
||||
<el-button link type="primary" icon="upload">上传DXF </el-button>
|
||||
</file-upload>
|
||||
|
||||
<el-button link type="success" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['project:project:edit']">修改 </el-button>
|
||||
<el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['project:project:remove']">删除 </el-button>
|
||||
</el-space>
|
||||
@ -82,44 +147,136 @@
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</el-card>
|
||||
<!-- 添加或修改项目对话框 -->
|
||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="770px" append-to-body>
|
||||
<el-form ref="projectFormRef" :model="form" :rules="rules" label-width="100px">
|
||||
<el-form-item label="项目名称" prop="projectName">
|
||||
<el-input v-model="form.projectName" placeholder="请输入项目名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="项目简称" prop="shortName">
|
||||
<el-input v-model="form.shortName" placeholder="请输入项目简称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="项目地址" prop="projectSite">
|
||||
<el-input v-model="form.projectSite" placeholder="请输入项目地址" />
|
||||
</el-form-item>
|
||||
<el-form-item label="负责人" prop="principal">
|
||||
<el-input v-model="form.principal" placeholder="请输入负责人" />
|
||||
</el-form-item>
|
||||
<el-form-item label="负责人电话" prop="principalPhone">
|
||||
<el-input v-model="form.principalPhone" placeholder="请输入负责人电话" />
|
||||
</el-form-item>
|
||||
<el-form-item label="实际容量" prop="actual">
|
||||
<el-input v-model="form.actual" placeholder="请输入实际容量" />
|
||||
</el-form-item>
|
||||
<el-form-item label="计划容量" prop="plan">
|
||||
<el-input v-model="form.plan" placeholder="请输入计划容量" />
|
||||
</el-form-item>
|
||||
<el-form-item label="开工时间" prop="onStreamTime">
|
||||
<el-date-picker clearable v-model="form.onStreamTime" type="date" value-format="YYYY-MM-DD" placeholder="请选择开工时间" />
|
||||
</el-form-item>
|
||||
<el-form-item label="打卡范围" prop="punchRange">
|
||||
<el-input v-model="form.punchRange" placeholder="请输入打卡范围" />
|
||||
</el-form-item>
|
||||
<el-form-item label="设计总量" prop="designTotal">
|
||||
<el-input v-model="form.designTotal" placeholder="请输入设计总量" />
|
||||
</el-form-item>
|
||||
<el-form-item label="安全协议书" prop="securityAgreement">
|
||||
<file-upload v-model="form.securityAgreement" :limit="1" :file-type="['pdf']" :file-size="50" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<div class="block-box">
|
||||
<div class="">基础信息</div>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="项目名称" prop="projectName">
|
||||
<el-input v-model="form.projectName" placeholder="请输入项目名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="项目简称" prop="shortName">
|
||||
<el-input v-model="form.shortName" placeholder="请输入项目简称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="负责人" prop="principal">
|
||||
<el-input v-model="form.principal" placeholder="请输入负责人" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="负责人电话" prop="principalPhone">
|
||||
<el-input v-model="form.principalPhone" placeholder="请输入负责人电话" type="number" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="项目类型" prop="projectType" label-width="100px">
|
||||
<el-select v-model="form.projectType" placeholder="请选择项目类型" clearable>
|
||||
<el-option v-for="dict in project_type" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="项目类别" prop="projectCategory" label-width="100px">
|
||||
<el-select v-model="form.projectCategory" placeholder="请选择项目类别" clearable>
|
||||
<el-option v-for="dict in project_category_type" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="开工时间" prop="onStreamTime">
|
||||
<el-date-picker clearable v-model="form.onStreamTime" type="date" value-format="YYYY-MM-DD" placeholder="请选择开工时间" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :push="3">
|
||||
<el-button type="primary" size="default" @click="amapStatus = true">获取经纬度</el-button>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="经度" prop="lng">
|
||||
<el-input v-model="form.lng" disabled placeholder="请输入经度" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="纬度" prop="lat">
|
||||
<el-input v-model="form.lat" disabled placeholder="请输入纬度" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" :offset="0">
|
||||
<el-form-item label="项目地址" prop="projectSite">
|
||||
<el-input v-model="form.projectSite" disabled placeholder="请输入项目地址" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="计划容量(M)" prop="plan">
|
||||
<el-input v-model="form.plan" placeholder="请输入计划容量" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="实际容量(M)" prop="actual">
|
||||
<el-input v-model="form.actual" placeholder="请输入实际容量" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="设计总量(M)" prop="designTotal">
|
||||
<el-input v-model="form.designTotal" placeholder="请输入设计总量" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" :offset="0">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="项目排序" prop="remark">
|
||||
<el-input-number v-model="form.sort" :min="0" :max="10000" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<div class="block-box">
|
||||
<div class="">打卡设置</div>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="打卡开始时间" prop="playCardStart" label-width="110px">
|
||||
<!-- <el-time-picker value-format="HH:mm" v-model="form.playCardStart" placeholder="请输入打卡开始时间" /> -->
|
||||
<el-time-select
|
||||
v-model="form.playCardStart"
|
||||
style="width: 100%"
|
||||
class="mr-4"
|
||||
placeholder="请输入打卡开始时间"
|
||||
value-format="HH:mm"
|
||||
start="00:00"
|
||||
step="00:15"
|
||||
end="23:59"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="打卡结束时间" prop="playCardEnd" label-width="110px">
|
||||
<!-- <el-time-picker value-format="HH:mm" v-model="form.playCardEnd" placeholder="请输入打卡结束时间" /> -->
|
||||
<el-time-select
|
||||
v-model="form.playCardEnd"
|
||||
style="width: 100%"
|
||||
:min-time="form.playCardStart"
|
||||
class="mr-4"
|
||||
placeholder="请输入打卡结束时间"
|
||||
value-format="HH:mm"
|
||||
start="00:00"
|
||||
step="00:15"
|
||||
end="23:59"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" :offset="0">
|
||||
<el-form-item label="安全协议书" prop="securityAgreement">
|
||||
<file-upload v-model="form.securityAgreement" :limit="1" :file-type="['pdf']" :file-size="50" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
@ -137,16 +294,52 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- //选取项目地址弹窗 -->
|
||||
<el-dialog v-model="amapStatus" :title="form.projectName + '-获取经纬度'" width="80%">
|
||||
<amap height="620px" @setLocation="setPoi"></amap>
|
||||
</el-dialog>
|
||||
<!-- 选取方阵地址 -->
|
||||
<el-dialog title="设置方阵" v-model="polygonStatus" width="1400px" :close-on-click-modal="false">
|
||||
<open-layers-map
|
||||
:project-id="projectId"
|
||||
:design-id="designId"
|
||||
@handleCheckChange="setCheckedNodes"
|
||||
@close="polygonStatus = false"
|
||||
></open-layers-map>
|
||||
</el-dialog>
|
||||
<el-dialog title="添加子项目" v-model="childProjectStatus" width="400">
|
||||
<span>填写子项目名称</span>
|
||||
<el-input v-model="childProjectForm.projectName"></el-input>
|
||||
<template #footer>
|
||||
<span>
|
||||
<el-button @click="childProjectStatus = false">取消</el-button>
|
||||
<el-button type="primary" @click="handleSetChild">确定</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Project" lang="ts">
|
||||
import { addProject, delProject, getProject, listProject, updateProject } from '@/api/project/project';
|
||||
import { ProjectForm, ProjectQuery, ProjectVO } from '@/api/project/project/types';
|
||||
|
||||
import {
|
||||
addChildProject,
|
||||
addProject,
|
||||
addProjectFacilities,
|
||||
addProjectPilePoint,
|
||||
addProjectSquare,
|
||||
delProject,
|
||||
getChildProject,
|
||||
getProject,
|
||||
listProject,
|
||||
updateProject
|
||||
} from '@/api/project/project';
|
||||
import { ProjectForm, ProjectQuery, ProjectVO, childProjectQuery, locationType } from '@/api/project/project/types';
|
||||
import amap from '@/components/amap/index.vue';
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { sys_normal_disable, project_category_type } = toRefs<any>(proxy?.useDict('sys_normal_disable', 'project_category_type'));
|
||||
|
||||
const { sys_normal_disable, project_category_type, project_type } = toRefs<any>(
|
||||
proxy?.useDict('sys_normal_disable', 'project_category_type', 'project_type')
|
||||
);
|
||||
const projectList = ref<ProjectVO[]>([]);
|
||||
const buttonLoading = ref(false);
|
||||
const loading = ref(true);
|
||||
@ -155,13 +348,27 @@ const ids = ref<Array<string | number>>([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
|
||||
const childProjectStatus = ref(false);
|
||||
const amapStatus = ref(false);
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const projectFormRef = ref<ElFormInstance>();
|
||||
const polygonStatus = ref(false);
|
||||
const dxfFile = ref(null);
|
||||
const projectId = ref<string>('');
|
||||
const designId = ref<string>('');
|
||||
const childProjectForm = reactive<childProjectQuery>({
|
||||
projectName: '',
|
||||
pid: '',
|
||||
id: ''
|
||||
});
|
||||
//被选中的节点
|
||||
const nodes = ref<any>([]);
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
});
|
||||
const jsonData = ref(null);
|
||||
const fullscreenLoading = ref(false);
|
||||
|
||||
const initFormData: ProjectForm = {
|
||||
id: undefined,
|
||||
@ -171,19 +378,22 @@ const initFormData: ProjectForm = {
|
||||
status: undefined,
|
||||
picUrl: undefined,
|
||||
remark: undefined,
|
||||
type: undefined,
|
||||
isType: undefined,
|
||||
projectType: undefined,
|
||||
projectCategory: undefined,
|
||||
deletedAt: undefined,
|
||||
projectSite: undefined,
|
||||
principal: undefined,
|
||||
principalPhone: undefined,
|
||||
actual: undefined,
|
||||
lng: undefined,
|
||||
lat: undefined,
|
||||
plan: undefined,
|
||||
onStreamTime: undefined,
|
||||
punchRange: undefined,
|
||||
playCardStart: undefined,
|
||||
playCardEnd: undefined,
|
||||
designTotal: undefined,
|
||||
securityAgreement: undefined,
|
||||
sort: undefined,
|
||||
sort: 0,
|
||||
showHidden: undefined,
|
||||
isDelete: undefined
|
||||
};
|
||||
@ -197,16 +407,19 @@ const data = reactive<PageData<ProjectForm, ProjectQuery>>({
|
||||
pId: undefined,
|
||||
status: undefined,
|
||||
picUrl: undefined,
|
||||
type: undefined,
|
||||
isType: undefined,
|
||||
projectType: undefined,
|
||||
projectCategory: undefined,
|
||||
deletedAt: undefined,
|
||||
projectSite: undefined,
|
||||
principal: undefined,
|
||||
principalPhone: undefined,
|
||||
actual: undefined,
|
||||
lng: undefined,
|
||||
lat: undefined,
|
||||
plan: undefined,
|
||||
onStreamTime: undefined,
|
||||
punchRange: undefined,
|
||||
playCardStart: undefined,
|
||||
playCardEnd: undefined,
|
||||
designTotal: undefined,
|
||||
securityAgreement: undefined,
|
||||
sort: undefined,
|
||||
@ -215,10 +428,19 @@ const data = reactive<PageData<ProjectForm, ProjectQuery>>({
|
||||
params: {}
|
||||
},
|
||||
rules: {
|
||||
punchRange: [{ required: true, message: '打卡范围不能为空', trigger: 'blur' }],
|
||||
playCardStart: [{ required: true, message: '打卡开始时间不能为空', trigger: 'blur' }],
|
||||
playCardEnd: [{ required: true, message: '打卡结束时间不能为空', trigger: 'blur' }],
|
||||
projectName: [{ required: true, message: '项目名称不能为空', trigger: 'blur' }],
|
||||
shortName: [{ required: true, message: '项目简称不能为空', trigger: 'blur' }],
|
||||
projectSite: [{ required: true, message: '项目地址不能为空', trigger: 'blur' }]
|
||||
principalPhone: [{ required: true, message: '负责人电话不能为空', trigger: 'blur' }],
|
||||
principal: [{ required: true, message: '负责人不能为空', trigger: 'blur' }],
|
||||
projectType: [{ required: true, message: '项目类型不能为空', trigger: 'blur' }],
|
||||
projectCategory: [{ required: true, message: '项目类别不能为空', trigger: 'blur' }],
|
||||
projectSite: [{ required: true, message: '项目地址不能为空', trigger: 'blur' }],
|
||||
actual: [{ required: true, message: '实际容量不能为空', trigger: 'blur' }],
|
||||
lng: [{ required: true, message: '经度不能为空', trigger: 'blur' }],
|
||||
lat: [{ required: true, message: '纬度不能为空', trigger: 'blur' }],
|
||||
plan: [{ required: true, message: '计划容量不能为空', trigger: 'blur' }]
|
||||
}
|
||||
});
|
||||
|
||||
@ -243,6 +465,63 @@ const reset = () => {
|
||||
projectFormRef.value?.resetFields();
|
||||
};
|
||||
|
||||
// 设置位置信息
|
||||
const setPoi = (location: locationType) => {
|
||||
if (location) {
|
||||
console.log('🚀 ~ setPoi ~ poi:', location);
|
||||
form.value.lng = location.lng;
|
||||
form.value.lat = location.lat;
|
||||
form.value.projectSite = location.projectSite;
|
||||
}
|
||||
|
||||
amapStatus.value = false;
|
||||
};
|
||||
//设置需要上传的节点
|
||||
const setCheckedNodes = (nodeList: any) => {
|
||||
nodes.value = nodeList;
|
||||
};
|
||||
//上传节点
|
||||
// const addFacilities = async () => {
|
||||
// if (!layerType.value) {
|
||||
// return proxy?.$modal.msgError('请选择图层类型');
|
||||
// }
|
||||
// if (!nodes.value.length) {
|
||||
// return proxy?.$modal.msgError('请选择需要上传的图层');
|
||||
// }
|
||||
// const data = {
|
||||
// projectId: projectId.value,
|
||||
// nameGeoJson: null,
|
||||
// locationGeoJson: null,
|
||||
// pointGeoJson: null
|
||||
// };
|
||||
// loading.value = true;
|
||||
// if (layerType.value == 1) {
|
||||
// if (nodes.value[0].option == '名称') {
|
||||
// data.nameGeoJson = jsonData.value[nodes.value[0].location.index];
|
||||
// data.locationGeoJson = jsonData.value[nodes.value[1].location.index];
|
||||
// } else {
|
||||
// data.nameGeoJson = jsonData.value[nodes.value[1].location.index];
|
||||
// data.locationGeoJson = jsonData.value[nodes.value[0].location.index];
|
||||
// }
|
||||
// await addProjectFacilities(data);
|
||||
// await proxy?.$modal.msgSuccess('添加成功');
|
||||
// } else if (layerType.value == 2) {
|
||||
// data.pointGeoJson = jsonData.value[nodes.value[0].location.index];
|
||||
// await addProjectPilePoint(data);
|
||||
// await proxy?.$modal.msgSuccess('添加成功');
|
||||
// } else if (layerType.value == 3) {
|
||||
// if (nodes.value[0].option == '名称') {
|
||||
// data.nameGeoJson = jsonData.value[nodes.value[0].location.index];
|
||||
// data.locationGeoJson = jsonData.value[nodes.value[1].location.index];
|
||||
// } else {
|
||||
// data.nameGeoJson = jsonData.value[nodes.value[1].location.index];
|
||||
// data.locationGeoJson = jsonData.value[nodes.value[0].location.index];
|
||||
// }
|
||||
// await addProjectSquare(data);
|
||||
// await proxy?.$modal.msgSuccess('添加成功');
|
||||
// }
|
||||
// loading.value = false;
|
||||
// };
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
@ -276,12 +555,12 @@ const handleUpdate = async (row?: ProjectVO) => {
|
||||
const res = await getProject(_id);
|
||||
Object.assign(form.value, res.data);
|
||||
dialog.visible = true;
|
||||
dialog.title = '修改项目';
|
||||
dialog.title = '修改-' + form.value.projectName;
|
||||
};
|
||||
|
||||
/** 上传安全协议书按钮操作 */
|
||||
const uploadVisible = ref<boolean>(false);
|
||||
const fileUploadParam = ref({
|
||||
const fileUploadParam = ref<{ id: string | number; securityAgreement: string }>({
|
||||
id: undefined,
|
||||
securityAgreement: undefined
|
||||
});
|
||||
@ -291,6 +570,12 @@ const handleShowUpload = (row?: ProjectVO) => {
|
||||
uploadVisible.value = true;
|
||||
};
|
||||
|
||||
const handleOpenLayer = async (row: ProjectVO) => {
|
||||
polygonStatus.value = true;
|
||||
projectId.value = row.id;
|
||||
designId.value = row.designId;
|
||||
};
|
||||
|
||||
const updateProjectFile = async () => {
|
||||
buttonLoading.value = true;
|
||||
await updateProject(fileUploadParam.value);
|
||||
@ -326,6 +611,50 @@ const handleDelete = async (row?: ProjectVO) => {
|
||||
await getList();
|
||||
};
|
||||
|
||||
//删除子项目
|
||||
const handleChildDel = async (id) => {
|
||||
await proxy?.$modal.confirm('是否确认删除项目编号为"' + id + '"的数据项?').finally(() => (loading.value = false));
|
||||
await delProject(id);
|
||||
proxy?.$modal.msgSuccess('删除成功');
|
||||
await getList();
|
||||
};
|
||||
|
||||
//增加/修改子项目
|
||||
const handleOpenSetChild = async (pid, id?, name?) => {
|
||||
childProjectStatus.value = true;
|
||||
childProjectForm.id = id;
|
||||
childProjectForm.pid = pid;
|
||||
childProjectForm.projectName = name;
|
||||
};
|
||||
|
||||
const resetChildQuert = () => {
|
||||
childProjectForm.id = '';
|
||||
childProjectForm.pid = '';
|
||||
childProjectForm.projectName = '';
|
||||
};
|
||||
|
||||
//增加/修改子项目
|
||||
const handleSetChild = async () => {
|
||||
if (!childProjectForm.projectName.trim()) return proxy.$modal.msgError('请填写项目名称');
|
||||
if (childProjectForm.id) {
|
||||
let res = await updateProject({ id: childProjectForm.id, projectName: childProjectForm.projectName });
|
||||
if (res.code == 200) {
|
||||
proxy.$modal.msgSuccess('修改成功');
|
||||
childProjectStatus.value = false;
|
||||
resetChildQuert();
|
||||
getList();
|
||||
}
|
||||
} else {
|
||||
let res = await addChildProject(childProjectForm);
|
||||
if (res.code == 200) {
|
||||
proxy.$modal.msgSuccess('添加成功');
|
||||
childProjectStatus.value = false;
|
||||
resetChildQuert();
|
||||
getList();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = () => {
|
||||
proxy?.download(
|
||||
@ -341,3 +670,17 @@ onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
<style scoped>
|
||||
.block-box {
|
||||
border: 1px solid #9eccfa;
|
||||
border-radius: 6px;
|
||||
padding: 10px 20px 0 10px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.block-box > div {
|
||||
color: #409eff;
|
||||
font-weight: 700;
|
||||
font-size: 14px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
</style>
|
||||
|
@ -14,7 +14,7 @@
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<!-- <el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button size="small" type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['project:projectTeamMember:add']"> 新增 </el-button>
|
||||
</el-col>
|
||||
@ -49,7 +49,7 @@
|
||||
导出
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-row> -->
|
||||
<el-table size="small" v-loading="loading" :data="projectTeamMemberList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="序号" type="index" width="60" align="center" />
|
||||
@ -66,8 +66,8 @@
|
||||
<el-button link type="success" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['project:projectTeamMember:edit']">
|
||||
修改
|
||||
</el-button>
|
||||
<el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['project:projectTeamMember:remove']">
|
||||
删除
|
||||
<el-button link type="danger" icon="Position" @click="handleExit(scope.row)" v-hasPermi="['project:projectTeamMember:remove']">
|
||||
退场
|
||||
</el-button>
|
||||
</el-space>
|
||||
</template>
|
||||
@ -85,7 +85,7 @@
|
||||
<!-- 添加或修改项目班组下的成员对话框 -->
|
||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
||||
<el-form ref="projectTeamMemberFormRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="施工人员" prop="memberId">
|
||||
<el-form-item label="施工人员" prop="memberId" v-if="!form.id">
|
||||
<el-select v-model="form.memberId" clearable placeholder="请选择人员" filterable>
|
||||
<el-option v-for="item in userNotInTeamOpt" :key="item.value" :label="item.label" :value="item.value" />
|
||||
<pagination
|
||||
@ -114,6 +114,27 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<!-- 上传退场记录 -->
|
||||
<el-dialog title="员工离场" v-model="memberStatus" width="30%">
|
||||
<el-form :model="memberForm" ref="memberFormRef" :rules="memberRules" label-width="100px" :inline="false">
|
||||
<el-form-item label="用户名">
|
||||
<el-input v-model="memberForm.userName" disabled></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="退场文件">
|
||||
<file-upload v-model="memberForm.filePath" :limit="10" :is-show-tip="false" :file-size="50" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="memberForm.remark" placeholder="请输入备注" type="textarea"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<template #footer>
|
||||
<span>
|
||||
<el-button type="primary" @click="submitMemberForm" :loading="buttonLoading">确定</el-button>
|
||||
<el-button @click="memberStatus = false">取消</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -129,8 +150,8 @@ import {
|
||||
} from '@/api/project/projectTeamMember';
|
||||
import { computed, reactive, ref } from 'vue';
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
import { listConstructionUser } from '@/api/project/constructionUser';
|
||||
import { ConstructionUserQuery, ConstructionUserVO } from '@/api/project/constructionUser/types';
|
||||
import { listConstructionUser, delConstructionUserMember } from '@/api/project/constructionUser';
|
||||
import { ConstructionUserQuery, ConstructionUserVO, ConstructionUserMembeForm } from '@/api/project/constructionUser/types';
|
||||
|
||||
// 获取用户 store
|
||||
const userStore = useUserStoreHook();
|
||||
@ -138,10 +159,16 @@ const userStore = useUserStoreHook();
|
||||
const currentProject = computed(() => userStore.selectedProject);
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { user_post_type } = toRefs<any>(proxy?.useDict('user_post_type'));
|
||||
|
||||
const memberStatus = ref(false);
|
||||
interface Props {
|
||||
projectTeamVo: ProjectTeamVO;
|
||||
}
|
||||
const memberForm = reactive<ConstructionUserMembeForm>({
|
||||
id: undefined,
|
||||
filePath: undefined,
|
||||
remark: undefined,
|
||||
userName: undefined
|
||||
});
|
||||
|
||||
const props = defineProps<Props>();
|
||||
// 是否可见
|
||||
@ -160,6 +187,9 @@ const data = reactive<PageData<ProjectTeamMemberForm, ProjectTeamMemberQuery>>({
|
||||
},
|
||||
rules: {
|
||||
id: [{ required: true, message: '主键id不能为空', trigger: 'blur' }]
|
||||
},
|
||||
memberRules: {
|
||||
filePath: [{ required: true, message: '请上传退场文件', trigger: 'blur' }]
|
||||
}
|
||||
});
|
||||
const buttonLoading = ref(false);
|
||||
@ -170,12 +200,13 @@ const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const projectTeamMemberFormRef = ref<ElFormInstance>();
|
||||
const memberFormRef = ref<ElFormInstance>();
|
||||
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
});
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
const { queryParams, form, rules, memberRules } = toRefs(data);
|
||||
const projectTeamMemberList = ref<ProjectTeamMemberVO[]>([]);
|
||||
/** 查询项目班组下的成员列表 */
|
||||
const getList = async () => {
|
||||
@ -277,6 +308,31 @@ const submitForm = () => {
|
||||
});
|
||||
};
|
||||
|
||||
/** 确定退场按钮 */
|
||||
const submitMemberForm = async () => {
|
||||
memberFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
await delConstructionUserMember(memberForm).finally(() => (buttonLoading.value = false));
|
||||
proxy?.$modal.msgSuccess('操作成功');
|
||||
dialog.visible = false;
|
||||
await getList();
|
||||
memberForm.filePath = undefined;
|
||||
memberForm.remark = undefined;
|
||||
}
|
||||
});
|
||||
memberStatus.value = false;
|
||||
};
|
||||
|
||||
/** 退场按钮操作 */
|
||||
const handleExit = async (row?: ProjectTeamMemberVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
memberForm.userName = row?.memberName;
|
||||
console.log('🚀 ~ handleDelete ~ row:', row);
|
||||
memberForm.id = row?.id;
|
||||
memberStatus.value = true;
|
||||
};
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: ProjectTeamMemberVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
|
@ -43,6 +43,11 @@
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="序号" type="index" width="60" align="center" />
|
||||
<el-table-column label="班组名称" align="center" prop="teamName" />
|
||||
<el-table-column label="班组人数" align="center" prop="peopleNumber">
|
||||
<template #default="scope">
|
||||
<el-link type="primary" :underline="false" @click="handleUserList(scope.row)"> {{ scope.row.peopleNumber }}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="打卡范围" align="center" prop="isClockIn">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="team_clock_type" :value="scope.row.isClockIn" />
|
||||
@ -86,7 +91,7 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<el-dialog :title="currentRow.teamName" v-model="visible">
|
||||
<el-dialog :title="currentRow.teamName" v-model="visible" width="1000px">
|
||||
<user-list-dialog :projectTeamVo="currentRow" />
|
||||
</el-dialog>
|
||||
</div>
|
||||
@ -134,7 +139,8 @@ const initFormData: ProjectTeamForm = {
|
||||
projectId: currentProject.value.id,
|
||||
teamName: undefined,
|
||||
isClockIn: undefined,
|
||||
remark: undefined
|
||||
remark: undefined,
|
||||
peopleNumber: undefined
|
||||
};
|
||||
const data = reactive<PageData<ProjectTeamForm, ProjectTeamQuery>>({
|
||||
form: { ...initFormData },
|
||||
@ -146,7 +152,8 @@ const data = reactive<PageData<ProjectTeamForm, ProjectTeamQuery>>({
|
||||
projectId: currentProject.value.id,
|
||||
teamName: undefined,
|
||||
isClockIn: undefined,
|
||||
params: {}
|
||||
params: {},
|
||||
peopleNumber: undefined
|
||||
},
|
||||
rules: {
|
||||
id: [{ required: true, message: '主键id不能为空', trigger: 'blur' }],
|
||||
@ -257,6 +264,19 @@ const handleExport = () => {
|
||||
`projectTeam_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
};
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
getList();
|
||||
}
|
||||
);
|
||||
|
||||
onUnmounted(() => {
|
||||
listeningProject();
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
|
@ -5,20 +5,20 @@
|
||||
<el-card shadow="hover">
|
||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||
<el-form-item label="工种" prop="workType">
|
||||
<el-select v-model="queryParams.workType" placeholder="请选择工种" clearable>
|
||||
<el-select v-model="queryParams.workType" placeholder="全部" clearable>
|
||||
<el-option v-for="dict in type_of_work" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="工资计算方式" prop="wageCalculationType" label-width="100px">
|
||||
<el-select v-model="queryParams.wageCalculationType" placeholder="请选择工资计算方式" clearable>
|
||||
<el-select v-model="queryParams.wageCalculationType" placeholder="全部" clearable>
|
||||
<el-option v-for="dict in wageCalculationTypeList" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="工资计量单位" prop="wageMeasureUnit" label-width="100px">
|
||||
<!-- <el-form-item label="工资计量单位" prop="wageMeasureUnit" label-width="100px">
|
||||
<el-select v-model="queryParams.wageMeasureUnit" placeholder="请选择工资计量单位" clearable>
|
||||
<el-option v-for="dict in wage_measure_unit_type" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
@ -100,7 +100,7 @@
|
||||
<el-input v-model="form.projectId" placeholder="请输入项目id" />
|
||||
</el-form-item> -->
|
||||
<el-form-item label="工种" prop="workType">
|
||||
<el-select v-model="form.workType" placeholder="请选择工种">
|
||||
<el-select v-model="form.workType" placeholder="请选择工种" :disabled="!form.id ? false : true">
|
||||
<el-option v-for="dict in type_of_work" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@ -110,18 +110,18 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="工资计算方式" prop="wageCalculationType">
|
||||
<el-select v-model="form.wageCalculationType" placeholder="请选择工资计算方式">
|
||||
<el-select v-model="form.wageCalculationType" placeholder="请选择工资计算方式" :disabled="!form.id ? false : true">
|
||||
<el-option v-for="dict in wageCalculationTypeList" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="工资标准" prop="wage">
|
||||
<el-input v-model="form.wage" placeholder="请输入工资标准" />
|
||||
</el-form-item>
|
||||
<el-form-item label="工资计量单位" prop="wageMeasureUnit">
|
||||
<!-- <el-form-item label="工资计量单位" prop="wageMeasureUnit">
|
||||
<el-select v-model="form.wageMeasureUnit" placeholder="请选择工资计量单位">
|
||||
<el-option v-for="dict in wage_measure_unit_type" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
@ -266,6 +266,7 @@ const submitForm = () => {
|
||||
workWageFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
form.value.projectId = currentProject.value.id;
|
||||
if (form.value.id) {
|
||||
await updateWorkWage(form.value).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
@ -298,6 +299,20 @@ const handleExport = () => {
|
||||
);
|
||||
};
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
getList();
|
||||
}
|
||||
);
|
||||
|
||||
onUnmounted(() => {
|
||||
listeningProject();
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
|
Reference in New Issue
Block a user