Compare commits

...

2 Commits

Author SHA1 Message Date
姜玉琦 e88f802800 Merge branch 'dev_xd' of http://62.234.3.186:3000/jiangyq/YZProjectCloud into dev_xd 2025-01-05 14:51:01 +08:00
姜玉琦 2bd827b5d2 提交代码 2025-01-05 14:50:51 +08:00
20 changed files with 348 additions and 490 deletions

View File

@ -5,12 +5,21 @@ package com.yanzhu.common.core.enums;
*/
public enum UserTypeEnums {
ZSRY("00", "正式人员",""),
LSRY("08", "临时人员",""),
ZSRY("00", "正式人员","key"),
LSRY("08", "临时人员","key"),
FBWTDL("80", "分包代理人","fbwtdl"),
FBXMJL("79", "分包项目经理","fbxmjl"),
FBBZZZ("78", "分包班组组长","fbbzzz"),
FBLWRY("77", "分包劳务人员","");
FBLWRY("77", "分包劳务人员","key"),
JSDWRY("69", "建设单位人员","jsdw"),
JLDWRY("68", "监理单位人员","jldw"),
SGDWRY("67", "施工单位人员","sgdw"),
CLFBRY("66", "材料分包人员","clfb"),
HQFBRY("65", "后勤分包人员","hqfb"),
TSSBRY("64", "特殊设备人员","tssb"),
KTDWRY("63", "勘探单位人员","ktdw"),
SJDWRY("62", "设计单位人员","sjdw"),
OTHER("59", "其它单位人员","other");
private final String code;
private final String info;

View File

@ -59,4 +59,9 @@ public interface ProProjectInfoSubdeptsGroupMapper
*/
public int deleteProProjectInfoSubdeptsGroupByIds(Long[] ids);
/**
*
* @param subDeptId
*/
public void updateUseStatusByParams(Long subDeptId);
}

View File

@ -100,4 +100,11 @@ public interface ProProjectInfoSubdeptsUsersMapper
*
*/
public List<Map<String, Object>> statsSubDeptsUsersByProId(ProProjectInfoSubdeptsUsers where);
/**
*
* @param subDeptId
* @param subDeptGroupId
*/
public void updateUseStatusByParams(@Param("subDeptId")Long subDeptId, @Param("subDeptGroupId")Long subDeptGroupId);
}

View File

@ -41,7 +41,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectProProjectInfoSubdeptsGroupList" parameterType="ProProjectInfoSubdeptsGroup" resultMap="ProProjectInfoSubdeptsGroupResult">
<include refid="selectProProjectInfoSubdeptsGroupVo"/>
<where>
psg.is_del != 2
<if test="comId != null "> and psg.com_id = #{comId}</if>
<if test="projectId != null "> and psg.project_id = #{projectId}</if>
<if test="activeComId != null "> and psg.com_id = #{activeComId}</if>
@ -55,6 +54,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="groupName != null and groupName != ''"> and psg.group_name like concat('%', #{groupName}, '%')</if>
<if test="craftType != null and craftType != ''"> and psg.craft_type = #{craftType}</if>
<if test="craftPost != null and craftPost != ''"> and psg.craft_post = #{craftPost}</if>
<if test="useStatus != null and useStatus != ''"> and psg.use_status = #{useStatus}</if>
and psg.is_del != 2
</where>
order by psg.id desc
</select>
@ -146,14 +147,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update>
<update id="deleteProProjectInfoSubdeptsGroupById" parameterType="Long">
update pro_project_info_subdepts_group set is_del=1 where id = #{id}
update pro_project_info_subdepts_group set is_del = 2 where id = #{id}
</update>
<update id="deleteProProjectInfoSubdeptsGroupByIds" parameterType="String">
update pro_project_info_subdepts_group set is_del=1 where id in
update pro_project_info_subdepts_group set is_del = 2 where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</update>
<update id="updateUseStatusByParams" parameterType="Long">
update pro_project_info_subdepts_group set use_status = 2 where id sub_dept_id = #{subDeptId}
</update>
</mapper>

View File

@ -45,7 +45,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectProProjectInfoSubdeptsList" parameterType="ProProjectInfoSubdepts" resultMap="ProProjectInfoSubdeptsResult">
<include refid="selectProProjectInfoSubdeptsVo"/>
<where>
ps.is_del = 0
<if test="comId != null "> and ps.com_id = #{comId}</if>
<if test="projectId != null "> and ps.project_id = #{projectId}</if>
<if test="activeComId != null "> and ps.com_id = #{activeComId}</if>
@ -57,6 +56,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="useStatus != null and useStatus != ''"> and ps.use_status = #{useStatus}</if>
<if test="approveStatus != null "> and ps.approve_status = #{approveStatus}</if>
<if test="subDeptLeaderPhone != null and subDeptLeaderPhone != ''"> and ps.sub_dept_leader_phone = #{subDeptLeaderPhone}</if>
and ps.is_del = 0
</where>
order by ps.id desc
</select>

View File

@ -70,7 +70,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectProProjectInfoSubdeptsUsersList" parameterType="ProProjectInfoSubdeptsUsers" resultMap="ProProjectInfoSubdeptsUsersResult">
<include refid="selectProProjectInfoSubdeptsUsersVo"/>
<where>
and psu.is_del != 2
<if test="comId != null "> and psu.com_id = #{comId}</if>
<if test="parId != null "> and psu.par_id = #{parId}</if>
<if test="projectId != null "> and psu.project_id = #{projectId}</if>
@ -94,6 +93,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="supIllnessStatus != null "> and psu.sup_illness_status = #{supIllnessStatus}</if>
<if test="userPhone != null and userPhone != ''"> and psu.user_phone = #{userPhone}</if>
<if test="isDel != null "> and psu.is_del = #{isDel}</if>
and psu.is_del != 2
</where>
</select>
@ -330,4 +330,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
group by u.craft_type,u.use_status
</select>
<update id="updateUseStatusByParams">
update pro_project_info_subdepts_group set use_status = 2
where 1=1
<if test="subDeptId != null "> and sub_dept_id = #{subDeptId}</if>
<if test="subDeptGroupId != null "> and u.sub_dept_group = #{subDeptGroupId}</if>
</update>
</mapper>

View File

@ -16,7 +16,7 @@ import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* Controller
* Controller
*
* @author JiangYuQi
* @date 2024-08-25
@ -29,7 +29,7 @@ public class ProProjectInfoSubdeptsController extends BaseController
private IProProjectInfoSubdeptsService proProjectInfoSubdeptsService;
/**
*
*
*/
@RequiresPermissions("manage:proProjectInfoSubdepts:list")
@GetMapping("/list")
@ -41,20 +41,20 @@ public class ProProjectInfoSubdeptsController extends BaseController
}
/**
*
*
*/
@RequiresPermissions("manage:proProjectInfoSubdepts:export")
@Log(title = "分包单位", businessType = BusinessType.EXPORT)
@Log(title = "参建单位", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, ProProjectInfoSubdepts proProjectInfoSubdepts)
{
List<ProProjectInfoSubdepts> list = proProjectInfoSubdeptsService.selectProProjectInfoSubdeptsList(proProjectInfoSubdepts);
ExcelUtil<ProProjectInfoSubdepts> util = new ExcelUtil<ProProjectInfoSubdepts>(ProProjectInfoSubdepts.class);
util.exportExcel(response, list, "分包单位数据");
util.exportExcel(response, list, "参建单位数据");
}
/**
*
*
* @RequiresPermissions("manage:proProjectInfoSubdepts:query")
*/
@GetMapping(value = "/{id}")
@ -64,10 +64,10 @@ public class ProProjectInfoSubdeptsController extends BaseController
}
/**
*
*
*/
@RequiresPermissions("manage:proProjectInfoSubdepts:add")
@Log(title = "分包单位", businessType = BusinessType.INSERT)
@Log(title = "参建单位", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody ProProjectInfoSubdepts proProjectInfoSubdepts)
{
@ -75,10 +75,10 @@ public class ProProjectInfoSubdeptsController extends BaseController
}
/**
*
*
*/
@RequiresPermissions("manage:proProjectInfoSubdepts:edit")
@Log(title = "分包单位", businessType = BusinessType.UPDATE)
@Log(title = "参建单位", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody ProProjectInfoSubdepts proProjectInfoSubdepts)
{
@ -86,21 +86,32 @@ public class ProProjectInfoSubdeptsController extends BaseController
}
/**
*
*
*/
@RequiresPermissions("manage:proProjectInfoSubdepts:edit")
@Log(title = "分包单位", businessType = BusinessType.UPDATE)
@PutMapping("/editInfos")
@Log(title = "参建单位", businessType = BusinessType.UPDATE)
@PostMapping("/editInfos")
public AjaxResult editInfos(@RequestBody ProProjectInfoSubdepts proProjectInfoSubdepts)
{
return toAjax(proProjectInfoSubdeptsService.updateProProjectInfoSubdeptsEntity(proProjectInfoSubdepts));
}
/**
*
* /
*/
@RequiresPermissions("manage:proProjectInfoSubdepts:edit")
@Log(title = "单位离场", businessType = BusinessType.UPDATE)
@GetMapping("/editUseStatus/{id}")
public AjaxResult editUseStatus(@PathVariable("id") Long id, String status)
{
return toAjax(proProjectInfoSubdeptsService.updateUseStatus(id,status));
}
/**
*
*/
@RequiresPermissions("manage:proProjectInfoSubdepts:remove")
@Log(title = "分包单位", businessType = BusinessType.DELETE)
@Log(title = "参建单位", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
@ -108,7 +119,7 @@ public class ProProjectInfoSubdeptsController extends BaseController
}
/**
*
*
*/
@GetMapping("/findAll")
public AjaxResult findAll(ProProjectInfoSubdepts proProjectInfoSubdepts)

View File

@ -16,7 +16,7 @@ import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* Controller
* Controller
*
* @author JiangYuqi
* @date 2024-08-25
@ -29,7 +29,7 @@ public class ProProjectInfoSubdeptsGroupController extends BaseController
private IProProjectInfoSubdeptsGroupService proProjectInfoSubdeptsGroupService;
/**
*
*
*/
@RequiresPermissions("manage:proProjectInfoSubdeptsGroup:list")
@GetMapping("/list")
@ -41,20 +41,20 @@ public class ProProjectInfoSubdeptsGroupController extends BaseController
}
/**
*
*
*/
@RequiresPermissions("manage:proProjectInfoSubdeptsGroup:export")
@Log(title = "分包单位班组", businessType = BusinessType.EXPORT)
@Log(title = "单位班组", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, ProProjectInfoSubdeptsGroup proProjectInfoSubdeptsGroup)
{
List<ProProjectInfoSubdeptsGroup> list = proProjectInfoSubdeptsGroupService.selectProProjectInfoSubdeptsGroupList(proProjectInfoSubdeptsGroup);
ExcelUtil<ProProjectInfoSubdeptsGroup> util = new ExcelUtil<ProProjectInfoSubdeptsGroup>(ProProjectInfoSubdeptsGroup.class);
util.exportExcel(response, list, "分包单位班组数据");
util.exportExcel(response, list, "单位班组数据");
}
/**
*
*
*/
@RequiresPermissions("manage:proProjectInfoSubdeptsGroup:query")
@GetMapping(value = "/{id}")
@ -64,10 +64,10 @@ public class ProProjectInfoSubdeptsGroupController extends BaseController
}
/**
*
*
*/
@RequiresPermissions("manage:proProjectInfoSubdeptsGroup:add")
@Log(title = "分包单位班组", businessType = BusinessType.INSERT)
@Log(title = "单位班组", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody ProProjectInfoSubdeptsGroup proProjectInfoSubdeptsGroup)
{
@ -75,10 +75,10 @@ public class ProProjectInfoSubdeptsGroupController extends BaseController
}
/**
*
*
*/
@RequiresPermissions("manage:proProjectInfoSubdeptsGroup:edit")
@Log(title = "分包单位班组", businessType = BusinessType.UPDATE)
@Log(title = "单位班组", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody ProProjectInfoSubdeptsGroup proProjectInfoSubdeptsGroup)
{
@ -86,10 +86,21 @@ public class ProProjectInfoSubdeptsGroupController extends BaseController
}
/**
*
* /
*/
@RequiresPermissions("manage:proProjectInfoSubdeptsGroup:edit")
@Log(title = "班组离场", businessType = BusinessType.UPDATE)
@GetMapping("/editUseStatus/{id}")
public AjaxResult editUseStatus(@PathVariable("id") Long id, String status)
{
return toAjax(proProjectInfoSubdeptsGroupService.updateUseStatus(id,status));
}
/**
*
*/
@RequiresPermissions("manage:proProjectInfoSubdeptsGroup:remove")
@Log(title = "分包单位班组", businessType = BusinessType.DELETE)
@Log(title = "单位班组", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{

View File

@ -186,4 +186,15 @@ public class ProProjectInfoSubdeptsUsersController extends BaseController
List<ProProjectInfoSubdeptsUsers> list = proProjectInfoSubdeptsUsersService.selectProProjectInfoSubdeptsUsersList(query);
return success(list);
}
/**
*
* @param proProjectInfoSubdeptsUsers
*/
@GetMapping("/findAllProSubDeptsUser")
public AjaxResult findAllProSubDeptsUser(ProProjectInfoSubdeptsUsers proProjectInfoSubdeptsUsers)
{
List<ProProjectInfoSubdeptsUsers> list = proProjectInfoSubdeptsUsersService.findAllProSubDeptsUser(proProjectInfoSubdeptsUsers);
return success(list);
}
}

View File

@ -43,6 +43,14 @@ public interface IProProjectInfoSubdeptsGroupService
*/
public int updateProProjectInfoSubdeptsGroup(ProProjectInfoSubdeptsGroup proProjectInfoSubdeptsGroup);
/**
*
* @param id
* @param status
* @return
*/
public int updateUseStatus(Long id, String status);
/**
*
*

View File

@ -70,6 +70,14 @@ public interface IProProjectInfoSubdeptsService
*/
public int updateProProjectInfoSubdeptsEntity(ProProjectInfoSubdepts proProjectInfoSubdepts);
/**
*
* @param id
* @param status
* @return
*/
public int updateUseStatus(Long id, String status);
/**
*
*

View File

@ -31,6 +31,14 @@ public interface IProProjectInfoSubdeptsUsersService
*/
public List<ProProjectInfoSubdeptsUsers> selectProProjectInfoSubdeptsUsersList(ProProjectInfoSubdeptsUsers proProjectInfoSubdeptsUsers);
/**
*
*
* @param proProjectInfoSubdeptsUsers
* @return
*/
public List<ProProjectInfoSubdeptsUsers> findAllProSubDeptsUser(ProProjectInfoSubdeptsUsers proProjectInfoSubdeptsUsers);
/**
*
*

View File

@ -2,10 +2,7 @@ package com.yanzhu.manage.service.impl;
import cn.binarywang.wx.miniapp.api.WxMaService;
import com.yanzhu.common.core.constant.SecurityConstants;
import com.yanzhu.common.core.enums.ApproveStatus;
import com.yanzhu.common.core.enums.CardTypeEnums;
import com.yanzhu.common.core.enums.ShiFouEnums;
import com.yanzhu.common.core.enums.UseStateEnums;
import com.yanzhu.common.core.enums.*;
import com.yanzhu.common.core.exception.ServiceException;
import com.yanzhu.common.core.utils.DateUtils;
import com.yanzhu.common.core.utils.StringUtils;
@ -314,6 +311,29 @@ public class ProProjectInfoSubdeptsGroupServiceImpl implements IProProjectInfoSu
return res;
}
/**
*
* @param id
* @param status
* @return
*/
@Override
public int updateUseStatus(Long id, String status){
if(StringUtils.isNotEmpty(status)){
ProProjectInfoSubdeptsGroup proProjectInfoSubdeptsGroup = proProjectInfoSubdeptsGroupMapper.selectProProjectInfoSubdeptsGroupById(id);
proProjectInfoSubdeptsGroup.setUseStatus(status);
proProjectInfoSubdeptsGroup.setUpdateBy(SecurityUtils.getUsername());
proProjectInfoSubdeptsGroup.setUpdateTime(DateUtils.getNowDate());
// 离场时所有人员全部离场
if(Objects.equals(UseStateEnums.OUT.getCode(), status)){
proProjectInfoSubdeptsUsersMapper.updateUseStatusByParams(proProjectInfoSubdeptsGroup.getSubDeptId(),proProjectInfoSubdeptsGroup.getId());
}
return proProjectInfoSubdeptsGroupMapper.updateProProjectInfoSubdeptsGroup(proProjectInfoSubdeptsGroup);
}else{
throw new ServiceException("参数异常");
}
}
/**
*
*

View File

@ -455,6 +455,30 @@ public class ProProjectInfoSubdeptsServiceImpl implements IProProjectInfoSubdept
return proProjectInfoSubdeptsMapper.updateProProjectInfoSubdepts(proProjectInfoSubdepts);
}
/**
*
* @param id
* @param status
* @return
*/
@Override
public int updateUseStatus(Long id, String status){
if(StringUtils.isNotEmpty(status)){
ProProjectInfoSubdepts proProjectInfoSubdepts = proProjectInfoSubdeptsMapper.selectProProjectInfoSubdeptsById(id);
proProjectInfoSubdepts.setUseStatus(status);
proProjectInfoSubdepts.setUpdateBy(SecurityUtils.getUsername());
proProjectInfoSubdepts.setUpdateTime(DateUtils.getNowDate());
// 离场时所有班组/人员全部离场
if(Objects.equals(UseStateEnums.OUT.getCode(), status)){
proProjectInfoSubdeptsGroupMapper.updateUseStatusByParams(proProjectInfoSubdepts.getId());
proProjectInfoSubdeptsUsersMapper.updateUseStatusByParams(proProjectInfoSubdepts.getId(),null);
}
return proProjectInfoSubdeptsMapper.updateProProjectInfoSubdepts(proProjectInfoSubdepts);
}else{
throw new ServiceException("参数异常");
}
}
/**
*
*

View File

@ -98,6 +98,18 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
return proProjectInfoSubdeptsUsersMapper.selectProProjectInfoSubdeptsUsersList(proProjectInfoSubdeptsUsers);
}
/**
*
*
* @param proProjectInfoSubdeptsUsers
* @return
*/
@Override
public List<ProProjectInfoSubdeptsUsers> findAllProSubDeptsUser(ProProjectInfoSubdeptsUsers proProjectInfoSubdeptsUsers)
{
return proProjectInfoSubdeptsUsersMapper.selectProProjectInfoSubdeptsUsersList(proProjectInfoSubdeptsUsers);
}
/**
*
*

View File

@ -1,6 +1,6 @@
import request from '@/utils/request'
// 查询分包单位列表
// 查询参建单位列表
export function findAllProjectInfoSubdepts(query) {
return request({
url: '/manage/proProjectInfoSubdepts/findAll',
@ -9,7 +9,7 @@ export function findAllProjectInfoSubdepts(query) {
})
}
// 查询分包单位列表
// 查询参建单位列表
export function listProProjectInfoSubdepts(query) {
return request({
url: '/manage/proProjectInfoSubdepts/list',
@ -18,7 +18,7 @@ export function listProProjectInfoSubdepts(query) {
})
}
// 查询分包单位详细
// 查询参建单位详细
export function getProProjectInfoSubdepts(id) {
return request({
url: '/manage/proProjectInfoSubdepts/' + id,
@ -26,7 +26,7 @@ export function getProProjectInfoSubdepts(id) {
})
}
// 新增分包单位
// 新增参建单位
export function addProProjectInfoSubdepts(data) {
return request({
url: '/manage/proProjectInfoSubdepts',
@ -35,7 +35,7 @@ export function addProProjectInfoSubdepts(data) {
})
}
// 修改分包单位
// 修改参建单位
export function updateProProjectInfoSubdepts(data) {
return request({
url: '/manage/proProjectInfoSubdepts',
@ -44,16 +44,24 @@ export function updateProProjectInfoSubdepts(data) {
})
}
// 修改分包单位
// 修改参建单位
export function updateProProjectInfoSubdeptsEntity(data) {
return request({
url: '/manage/proProjectInfoSubdepts/editInfos',
method: 'put',
method: 'post',
data: data
})
}
// 删除分包单位
// 修改参建单位
export function editUseStatus(id,status) {
return request({
url: '/manage/proProjectInfoSubdepts/editUseStatus/'+id+'?status='+status,
method: 'get'
})
}
// 删除参建单位
export function delProProjectInfoSubdepts(id) {
return request({
url: '/manage/proProjectInfoSubdepts/' + id,

View File

@ -35,6 +35,14 @@ export function updateProProjectInfoSubdeptsGroup(data) {
})
}
// 修改分包单位班组
export function editUseStatus(id,status) {
return request({
url: '/manage/proProjectInfoSubdeptsGroup/editUseStatus/'+id+'?status='+status,
method: 'get'
})
}
// 删除分包单位班组
export function delProProjectInfoSubdeptsGroup(id) {
return request({

View File

@ -4,20 +4,20 @@
<el-form-item label="项目名称" prop="projectName" v-if="!userStore.currentPrjId">
<el-input v-model="queryParams.projectName" placeholder="请输入项目名称" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="单位名称" prop="subDeptName">
<el-input v-model="queryParams.subDeptName" placeholder="请输入参建单位名称" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="单位类型" prop="subDeptType">
<el-select v-model="queryParams.subDeptType" placeholder="请选择参建单位类型" clearable style="width:150px;">
<el-select v-model="queryParams.subDeptType" placeholder="请选择参建单位类型" clearable>
<el-option v-for="dict in sub_dept_type" :key="dict.value" :label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
<el-form-item label="进场状态" prop="useStatus">
<el-select v-model="queryParams.useStatus" placeholder="请选择进场状态" clearable style="width:150px;">
<el-select v-model="queryParams.useStatus" placeholder="请选择进场状态" clearable>
<el-option v-for="dict in sys_use_status" :key="dict.value" :label="dict.label"
:value="dict.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="单位名称" prop="subDeptName">
<el-input v-model="queryParams.subDeptName" placeholder="请输入参建单位名称" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery"></el-button>
<el-button icon="Refresh" @click="resetQuery"></el-button>
@ -71,19 +71,24 @@
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="审批状态" align="center" prop="approveStatus">
<el-table-column label="审批状态" align="center" prop="approveStatus" width="100">
<template #default="scope">
<dict-tag :options="sys_approve_status" :value="scope.row.approveStatus" />
</template>
</el-table-column>
<el-table-column label="数据状态" align="center" prop="isDel" width="80">
<template #default="scope">
<dict-tag :options="sys_is_del" :value="scope.row.isDel" />
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" width="150" align="center" class-name="small-padding fixed-width">
<template #default="scope">
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
v-hasPermi="['manage:proProjectInfoSubdepts:edit']">修改</el-button>
<el-button v-if="scope.row.useStatus == '1'" link type="primary" icon="Setting"
@click="handleUseStatus(scope.row)" v-hasPermi="['manage:proProjectInfoSubdepts:remove']">离场</el-button>
@click="handleUseStatus(scope.row)" v-hasPermi="['manage:proProjectInfoSubdepts:edit']">离场</el-button>
<el-button v-if="scope.row.useStatus == '2'" link type="primary" icon="Setting"
@click="handleUseStatus(scope.row)" v-hasPermi="['manage:proProjectInfoSubdepts:remove']">进场</el-button>
@click="handleUseStatus(scope.row)" v-hasPermi="['manage:proProjectInfoSubdepts:edit']">进场</el-button>
</template>
</el-table-column>
</el-table>
@ -114,6 +119,12 @@
<el-form-item label="进场时间" prop="useDates">
<el-date-picker v-model="form.useDates" type="date" placeholder="请选择进场时间" style="width:100%" />
</el-form-item>
<el-form-item label="开工时间" prop="startWorkDates" v-if="form.subDeptType == '4' || form.subDeptType == '5'">
<el-date-picker v-model="form.startWorkDates" type="date" placeholder="请选择计划开工时间" style="width:100%" />
</el-form-item>
<el-form-item label="完工时间" prop="endWorkDates" v-if="form.subDeptType == '4' || form.subDeptType == '5'">
<el-date-picker v-model="form.endWorkDates" type="date" placeholder="请选择计划完工时间" style="width:100%" />
</el-form-item>
<el-form-item label="进场状态" prop="useStatus">
<el-select v-model="form.useStatus" placeholder="请选择进场状态" style="width:100%">
<el-option v-for="dict in sys_use_status" :key="dict.value" :label="dict.label"
@ -124,12 +135,6 @@
<el-input v-model="form.contractInfos" maxlength="2000" show-word-limit type="textarea" rows="4"
placeholder="请输入承包范围" />
</el-form-item>
<el-form-item label="计划开工时间" v-if="form.subDeptType == '4' || form.subDeptType == '5'">
</el-form-item>
<el-form-item label="计划完工时间" v-if="form.subDeptType == '4' || form.subDeptType == '5'">
</el-form-item>
</el-tab-pane>
<el-tab-pane label="单位信息" name="infos">
<el-form-item label="经营范围">
@ -217,11 +222,11 @@
</template>
<script setup name="ProProjectInfoSubdepts">
import { listProProjectInfoSubdepts, getProProjectInfoSubdepts, delProProjectInfoSubdepts, addProProjectInfoSubdepts, updateProProjectInfoSubdepts, updateProProjectInfoSubdeptsEntity } from "@/api/manage/proProjectInfoSubdepts";
import { listProProjectInfoSubdepts, getProProjectInfoSubdepts, delProProjectInfoSubdepts, addProProjectInfoSubdepts, updateProProjectInfoSubdepts, editUseStatus } from "@/api/manage/proProjectInfoSubdepts";
import useUserStore from '@/store/modules/user'
const { proxy } = getCurrentInstance();
const { sys_use_status, sub_dept_type, sys_approve_status } = proxy.useDict('sys_use_status', 'sub_dept_type', 'sys_approve_status');
const { sys_use_status, sub_dept_type, sys_approve_status, sys_is_del } = proxy.useDict('sys_use_status', 'sub_dept_type', 'sys_approve_status', 'sys_is_del');
const userStore = useUserStore()
const proProjectInfoSubdeptsList = ref([]);
@ -254,6 +259,8 @@ const data = reactive({
subDeptName: [{ required: true, message: "单位名称不能为空", trigger: "blur" }],
subDeptCode: [{ required: true, message: "信用代码不能为空", trigger: "blur" }],
useDates: [{ required: true, message: "进场时间不能为空", trigger: "change" }],
startWorkDates: [{ required: true, message: "计划开工时间不能为空", trigger: "change" }],
endWorkDates: [{ required: true, message: "计划完工时间不能为空", trigger: "change" }],
useStatus: [{ required: true, message: "进场状态不能为空", trigger: "change" }],
contractInfos: [{ required: true, message: "合同承包范围不能为空", trigger: "blur" }]
}
@ -391,9 +398,10 @@ function handleDelete(row) {
/** 进场/退场操作 */
function handleUseStatus(row) {
let state = row.useStatus == '1' ? "离场" : "进场";
proxy.$modal.confirm('是否确认修改单位状态为"' + state + '"').then(function () {
return updateProProjectInfoSubdeptsEntity({ 'id': row.id, 'useStatus': row.useStatus == '1' ? "2" : "1" });
let state = row.useStatus == '1' ? "2" : "1"
let stateMsg = row.useStatus == '1' ? "离场" : "进场";
proxy.$modal.confirm('是否确认修改单位状态为"' + stateMsg + '"').then(function () {
return editUseStatus(row.id,state);
}).then(() => {
getList();
proxy.$modal.msgSuccess("修改成功");
@ -417,7 +425,6 @@ getList();
.SubdeptsDlg {
.el-dialog__body {
margin-top: -25px;
overflow: auto;
max-height: 680px;
}

View File

@ -8,7 +8,7 @@
<el-input v-model="queryParams.subDeptName" placeholder="请输入单位名称" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="单位类型" prop="subDeptType">
<el-select v-model="queryParams.subDeptType" placeholder="请选择单位类型" clearable style="width:150px;">
<el-select v-model="queryParams.subDeptType" placeholder="请选择单位类型" clearable>
<el-option v-for="dict in sub_dept_type" :key="dict.value" :label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
@ -16,12 +16,12 @@
<el-input v-model="queryParams.groupName" placeholder="请输入班组名称" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="工种类型" prop="craftType">
<el-select v-model="queryParams.craftType" placeholder="请选择工种类型" clearable style="width:150px;">
<el-select v-model="queryParams.craftType" placeholder="请选择工种类型" clearable>
<el-option v-for="dict in pro_craft_type" :key="dict.value" :label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
<el-form-item label="工种岗位" prop="craftPost">
<el-select v-model="queryParams.craftPost" placeholder="请选择工种岗位" clearable style="width:150px;">
<el-select v-model="queryParams.craftPost" placeholder="请选择工种岗位" clearable>
<el-option v-for="dict in pro_craft_post" :key="dict.value" :label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
@ -72,21 +72,37 @@
<dict-tag :options="pro_craft_post" :value="scope.row.craftPost" />
</template>
</el-table-column>
<el-table-column label="班组长" align="center" prop="groupLeaderName" />
<el-table-column label="班组长" align="center" prop="groupLeaderName" >
<template #default="scope">
<el-button link v-if="scope.row.groupLeaderName" type="primary" icon="UserFilled"
@click="handleUpdateGroupLeader(scope.row)">{{scope.row.groupLeaderName}}</el-button>
<el-button link v-if="!scope.row.groupLeaderName" type="warning" icon="UserFilled"
@click="handleUpdateGroupLeader(scope.row)"> - </el-button>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" width="120">
<template #default="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="审批状态" align="center" prop="approveStatus">
<el-table-column label="审批状态" align="center" prop="approveStatus" width="100">
<template #default="scope">
<dict-tag :options="sys_approve_status" :value="scope.row.approveStatus" />
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" width="120" align="center" class-name="small-padding fixed-width">
<el-table-column label="数据状态" align="center" prop="isDel" width="80">
<template #default="scope">
<dict-tag :options="sys_is_del" :value="scope.row.isDel" />
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" width="150" align="center" class-name="small-padding fixed-width">
<template #default="scope">
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
v-hasPermi="['manage:proProjectInfoSubdeptsGroup:edit']">修改</el-button>
<el-button v-if="scope.row.useStatus == '1'" link type="primary" icon="Setting"
@click="handleUseStatus(scope.row)" v-hasPermi="['manage:proProjectInfoSubdeptsGroup:edit']">离场</el-button>
<el-button v-if="scope.row.useStatus == '2'" link type="primary" icon="Setting"
@click="handleUseStatus(scope.row)" v-hasPermi="['manage:proProjectInfoSubdeptsGroup:edit']">进场</el-button>
</template>
</el-table-column>
</el-table>
@ -97,60 +113,61 @@
<!-- 添加或修改单位班组对话框 -->
<el-dialog :title="title" v-model="open" width="680px" append-to-body modal-class="SubdeptsGroupDlg">
<el-form ref="proProjectInfoSubdeptsGroupRef" :model="form" :rules="rules" label-width="88px">
<el-tabs v-model="activeTabs" type="card" class="demo-tabs">
<el-tab-pane label="基本信息" name="base">
<el-form-item label="项目名称" v-if="form.projectId">
<el-tag effect="plain">{{ form.projectName }}</el-tag>
</el-form-item>
<el-form-item label="所属单位" prop="subDeptId">
<el-select v-model="form.subDeptId" placeholder="请选择所属单位" style="width:100%">
<el-option v-for="dept in subDeptOptions" :key="dept.id" :label="dept.subDeptName"
:value="dept.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="工种类型" prop="craftType">
<el-select v-model="form.craftType" placeholder="请选择工种类型" style="width:100%">
<el-option v-for="dict in pro_craft_type" :key="dict.value" :label="dict.label"
:value="dict.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="工种岗位" prop="craftPost">
<el-select v-model="form.craftPost" placeholder="请选择工种岗位" style="width:100%">
<el-option v-for="dict in pro_craft_post" :key="dict.value" :label="dict.label"
:value="dict.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="班组名称" prop="groupName">
<el-input v-model="form.groupName" placeholder="请输入班组名称" maxlength="32" show-word-limit />
</el-form-item>
</el-tab-pane>
<el-tab-pane label="班组长信息" name="groupLeader">
<el-form-item label="班组长姓名" prop="groupLeaderName">
<el-input v-model="form.groupLeaderName" placeholder="请输入班组长姓名" maxlength="10" show-word-limit />
</el-form-item>
<el-form-item label="身份证号码" prop="groupLeaderCode">
<el-input v-model="form.groupLeaderCode" placeholder="请输入班组长身份证号码" maxlength="18" show-word-limit />
</el-form-item>
<el-form-item label="班组长电话" prop="groupLeaderPhone">
<el-input v-model="form.groupLeaderPhone" placeholder="请输入班组长电话" maxlength="11" show-word-limit />
</el-form-item>
<el-row>
<el-col :span="12">
<el-form-item label="身份证正面">
<image-upload v-model="form.grouLeaderCardImgPos" :limit="1" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="身份证反面">
<image-upload v-model="form.grouLeaderCardImgInv" :limit="1" />
</el-form-item>
</el-col>
</el-row>
<el-form-item label="班组长照片">
<image-upload v-model="form.grouLeaderUserPicture" :limit="1" />
</el-form-item>
</el-tab-pane>
</el-tabs>
<el-form-item label="项目名称" v-if="form.projectId">
<el-tag effect="plain">{{ form.projectName }}</el-tag>
</el-form-item>
<el-form-item label="所属单位" prop="subDeptId">
<el-select v-model="form.subDeptId" placeholder="请选择所属单位" style="width:100%">
<el-option v-for="dept in subDeptOptions" :key="dept.id" :label="dept.subDeptName"
:value="dept.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="工种类型" prop="craftType">
<el-select v-model="form.craftType" placeholder="请选择工种类型" style="width:100%">
<el-option v-for="dict in pro_craft_type" :key="dict.value" :label="dict.label"
:value="dict.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="工种岗位" prop="craftPost">
<el-select v-model="form.craftPost" placeholder="请选择工种岗位" style="width:100%">
<el-option v-for="dict in pro_craft_post" :key="dict.value" :label="dict.label"
:value="dict.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="班组名称" prop="groupName">
<el-input v-model="form.groupName" placeholder="请输入班组名称" maxlength="32" show-word-limit />
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
<!-- 添加或修改单位班组对话框 -->
<el-dialog :title="title" v-model="open" width="680px" append-to-body modal-class="SubdeptsGroupDlg">
<el-form ref="proProjectInfoSubdeptsGroupRef" :model="leaderForm" :rules="leaderRules" label-width="88px">
<el-form-item label="项目名称">
<el-tag effect="plain">{{ leaderForm.projectName }}</el-tag>
</el-form-item>
<el-form-item label="参建单位">
{{leaderForm.subDeptName}}
</el-form-item>
<el-form-item label="班组类型">
<span v-if="leaderForm.craftType!=3">{{leaderForm.craftType=='1'?'':''}} {{leaderForm.craftPostName}} </span>
<span v-if="leaderForm.craftType==3"></span>
</el-form-item>
<el-form-item label="班组名称">
{{leaderForm.groupName}}
</el-form-item>
<el-form-item label="班组组长" prop="groupLeaderPhone">
<el-select v-model="form.groupLeaderPhone" placeholder="请选择班组组长" style="width:100%">
<el-option v-for="dict in pro_craft_post" :key="dict.value" :label="dict.label"
:value="dict.value"></el-option>
</el-select>
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
@ -164,7 +181,7 @@
<script setup name="ProProjectInfoSubdeptsGroup">
import { findAllProjectInfoSubdepts } from "@/api/manage/proProjectInfoSubdepts";
import { listProProjectInfoSubdeptsGroup, getProProjectInfoSubdeptsGroup, delProProjectInfoSubdeptsGroup, addProProjectInfoSubdeptsGroup, updateProProjectInfoSubdeptsGroup } from "@/api/manage/proProjectInfoSubdeptsGroup";
import { listProProjectInfoSubdeptsGroup, getProProjectInfoSubdeptsGroup, delProProjectInfoSubdeptsGroup, addProProjectInfoSubdeptsGroup, updateProProjectInfoSubdeptsGroup, editUseStatus } from "@/api/manage/proProjectInfoSubdeptsGroup";
import useUserStore from '@/store/modules/user'
const { proxy } = getCurrentInstance();
@ -173,6 +190,7 @@ const { sys_approve_status, sub_dept_type, pro_craft_type, sys_is_del, pro_craft
const userStore = useUserStore()
const proProjectInfoSubdeptsGroupList = ref([]);
const open = ref(false);
const leaderOpen = ref(false);
const loading = ref(true);
const showSearch = ref(true);
const ids = ref([]);
@ -180,11 +198,14 @@ const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const title = ref("");
const leaderTitle = ref("");
const activeTabs = ref("base");
const subDeptOptions = ref([]);
const groupLeaderOptions = ref([]);
const data = reactive({
form: {},
leaderForm: {},
queryParams: {
pageNum: 1,
pageSize: 10,
@ -201,10 +222,13 @@ const data = reactive({
craftType: [{ required: true, message: "工种类型不能为空", trigger: "change" }],
craftPost: [{ required: true, message: "工种岗位不能为空", trigger: "change" }],
groupName: [{ required: true, message: "班组名称不能为空", trigger: "blur" }],
},
leaderRules: {
groupLeaderPhone: [{ required: true, message: "班组组长不能为空", trigger: "change" }]
}
});
const { queryParams, form, rules } = toRefs(data);
const { queryParams, form, rules, leaderForm } = toRefs(data);
/** 查询单位班组列表 */
function getList() {
@ -298,6 +322,19 @@ function handleUpdate(row) {
});
}
/** 修改班组长按钮操作 */
function handleUpdateGroupLeader(row) {
open.value = true;
title.value = "修改单位班组长";
reset();
initSubDeptOptions(row.projectId);
const _id = row.id || ids.value
getProProjectInfoSubdeptsGroup(_id).then(response => {
form.value = response.data;
});
}
/** 提交按钮 */
function submitForm() {
proxy.$refs["proProjectInfoSubdeptsGroupRef"].validate(valid => {
@ -331,6 +368,18 @@ function handleDelete(row) {
}).catch(() => { });
}
/** 进场/退场操作 */
function handleUseStatus(row) {
let state = row.useStatus == '1' ? "2" : "1"
let stateMsg = row.useStatus == '1' ? "离场" : "进场";
proxy.$modal.confirm('是否确认修改班组状态为"' + stateMsg + '"').then(function () {
return editUseStatus(row.id,state);
}).then(() => {
getList();
proxy.$modal.msgSuccess("修改成功");
}).catch(() => { });
}
/** 导出按钮操作 */
function handleExport() {
proxy.download('manage/proProjectInfoSubdeptsGroup/export', {

View File

@ -1,360 +0,0 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="单位主键" prop="deptId">
<el-input
v-model="queryParams.deptId"
placeholder="请输入单位主键"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="项目主键" prop="projectId">
<el-input
v-model="queryParams.projectId"
placeholder="请输入项目主键"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="用户主键" prop="userId">
<el-input
v-model="queryParams.userId"
placeholder="请输入用户主键"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="用户姓名" prop="userName">
<el-input
v-model="queryParams.userName"
placeholder="请输入用户姓名"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="用户编号" prop="userCode">
<el-input
v-model="queryParams.userCode"
placeholder="请输入用户编号"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="用户电话" prop="userPhone">
<el-input
v-model="queryParams.userPhone"
placeholder="请输入用户电话"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="进场状态" prop="useStatus">
<el-select v-model="queryParams.useStatus" placeholder="请选择进场状态" clearable>
<el-option
v-for="dict in sys_use_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="删除标识" prop="isDel">
<el-select v-model="queryParams.isDel" placeholder="请选择删除标识" clearable>
<el-option
v-for="dict in sys_is_del"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery"></el-button>
<el-button icon="Refresh" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="Plus"
@click="handleAdd"
v-hasPermi="['manage:proProjectInfoUsers:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="Edit"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['manage:proProjectInfoUsers:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="Delete"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['manage:proProjectInfoUsers:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="Download"
@click="handleExport"
v-hasPermi="['manage:proProjectInfoUsers:export']"
>导出</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="proProjectInfoUsersList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键" align="center" prop="id" />
<el-table-column label="单位主键" align="center" prop="deptId" />
<el-table-column label="项目主键" align="center" prop="projectId" />
<el-table-column label="用户主键" align="center" prop="userId" />
<el-table-column label="用户姓名" align="center" prop="userName" />
<el-table-column label="用户编号" align="center" prop="userCode" />
<el-table-column label="用户电话" align="center" prop="userPhone" />
<el-table-column label="进场状态" align="center" prop="useStatus">
<template #default="scope">
<dict-tag :options="sys_use_status" :value="scope.row.useStatus"/>
</template>
</el-table-column>
<el-table-column label="删除标识" align="center" prop="isDel">
<template #default="scope">
<dict-tag :options="sys_is_del" :value="scope.row.isDel"/>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope">
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['manage:proProjectInfoUsers:edit']"></el-button>
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['manage:proProjectInfoUsers:remove']"></el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改项目人员对话框 -->
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
<el-form ref="proProjectInfoUsersRef" :model="form" :rules="rules" label-width="80px">
<el-form-item label="单位主键" prop="deptId">
<el-input v-model="form.deptId" placeholder="请输入单位主键" />
</el-form-item>
<el-form-item label="项目主键" prop="projectId">
<el-input v-model="form.projectId" placeholder="请输入项目主键" />
</el-form-item>
<el-form-item label="用户主键" prop="userId">
<el-input v-model="form.userId" placeholder="请输入用户主键" />
</el-form-item>
<el-form-item label="用户姓名" prop="userName">
<el-input v-model="form.userName" placeholder="请输入用户姓名" />
</el-form-item>
<el-form-item label="用户编号" prop="userCode">
<el-input v-model="form.userCode" placeholder="请输入用户编号" />
</el-form-item>
<el-form-item label="用户电话" prop="userPhone">
<el-input v-model="form.userPhone" placeholder="请输入用户电话" />
</el-form-item>
<el-form-item label="进场状态" prop="useStatus">
<el-select v-model="form.useStatus" placeholder="请选择进场状态">
<el-option
v-for="dict in sys_use_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="删除标识" prop="isDel">
<el-select v-model="form.isDel" placeholder="请选择删除标识">
<el-option
v-for="dict in sys_is_del"
:key="dict.value"
:label="dict.label"
:value="parseInt(dict.value)"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup name="ProProjectInfoUsers">
import { listProProjectInfoUsers, getProProjectInfoUsers, delProProjectInfoUsers, addProProjectInfoUsers, updateProProjectInfoUsers } from "@/api/manage/proProjectInfoUsers";
const { proxy } = getCurrentInstance();
const { sys_use_status, sys_is_del } = proxy.useDict('sys_use_status', 'sys_is_del');
const proProjectInfoUsersList = ref([]);
const open = ref(false);
const loading = ref(true);
const showSearch = ref(true);
const ids = ref([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const title = ref("");
const data = reactive({
form: {},
queryParams: {
pageNum: 1,
pageSize: 10,
deptId: null,
projectId: null,
userId: null,
userName: null,
userCode: null,
userPhone: null,
useStatus: null,
isDel: null,
},
rules: {
}
});
const { queryParams, form, rules } = toRefs(data);
/** 查询项目人员列表 */
function getList() {
loading.value = true;
listProProjectInfoUsers(queryParams.value).then(response => {
proProjectInfoUsersList.value = response.rows;
total.value = response.total;
loading.value = false;
});
}
//
function cancel() {
open.value = false;
reset();
}
//
function reset() {
form.value = {
id: null,
deptId: null,
projectId: null,
userId: null,
userName: null,
userCode: null,
userPhone: null,
useStatus: null,
isDel: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null
};
proxy.resetForm("proProjectInfoUsersRef");
}
/** 搜索按钮操作 */
function handleQuery() {
queryParams.value.pageNum = 1;
getList();
}
/** 重置按钮操作 */
function resetQuery() {
proxy.resetForm("queryRef");
handleQuery();
}
//
function handleSelectionChange(selection) {
ids.value = selection.map(item => item.id);
single.value = selection.length != 1;
multiple.value = !selection.length;
}
/** 新增按钮操作 */
function handleAdd() {
reset();
open.value = true;
title.value = "添加项目人员";
}
/** 修改按钮操作 */
function handleUpdate(row) {
reset();
const _id = row.id || ids.value
getProProjectInfoUsers(_id).then(response => {
form.value = response.data;
open.value = true;
title.value = "修改项目人员";
});
}
/** 提交按钮 */
function submitForm() {
proxy.$refs["proProjectInfoUsersRef"].validate(valid => {
if (valid) {
if (form.value.id != null) {
updateProProjectInfoUsers(form.value).then(response => {
proxy.$modal.msgSuccess("修改成功");
open.value = false;
getList();
});
} else {
addProProjectInfoUsers(form.value).then(response => {
proxy.$modal.msgSuccess("新增成功");
open.value = false;
getList();
});
}
}
});
}
/** 删除按钮操作 */
function handleDelete(row) {
const _ids = row.id || ids.value;
proxy.$modal.confirm('是否确认删除项目人员编号为"' + _ids + '"的数据项?').then(function() {
return delProProjectInfoUsers(_ids);
}).then(() => {
getList();
proxy.$modal.msgSuccess("删除成功");
}).catch(() => {});
}
/** 导出按钮操作 */
function handleExport() {
proxy.download('manage/proProjectInfoUsers/export', {
...queryParams.value
}, `proProjectInfoUsers_${new Date().getTime()}.xlsx`)
}
getList();
</script>