综合服务中心审核

This commit is contained in:
bns_han 2024-03-20 11:17:46 +08:00
parent 04b0fb11b5
commit a6830079e1
27 changed files with 3084 additions and 39 deletions

View File

@ -0,0 +1,59 @@
package com.bonus.sgzb.material.controller;
import com.bonus.sgzb.common.core.utils.poi.ExcelUtil;
import com.bonus.sgzb.common.core.web.controller.BaseController;
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
import com.bonus.sgzb.common.log.annotation.Log;
import com.bonus.sgzb.common.log.enums.BusinessType;
import com.bonus.sgzb.material.domain.InputRecord;
import com.bonus.sgzb.material.domain.ScrapRecord;
import com.bonus.sgzb.material.service.InputRecordService;
import com.bonus.sgzb.material.service.ScrapRecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* @description 综合查询--机具入库查询
* @author hay
* @date 2024/2/26 14:15
*/
@Api(tags = "综合查询--机具入库查询")
@RestController
@RequestMapping("/inputRecord")
public class InputRecordController extends BaseController {
@Autowired
private InputRecordService inputRecordService;
/**
* 机具入库查询列表
*/
@ApiOperation(value = "综合查询--机具入库查询列表")
@GetMapping("/getInputRecordList")
public AjaxResult getInputRecordList(InputRecord bean) {
startPage();
List<InputRecord> list = inputRecordService.getInputRecordList(bean);
return AjaxResult.success(getDataTable(list));
}
/**
* 导出综合查询机具入库查询列表
*/
@ApiOperation("导出综合查询机具入库查询列表")
@Log(title = "导出综合查询机具入库查询列表", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, InputRecord bean)
{
List<InputRecord> list = inputRecordService.getInputRecordList(bean);
ExcelUtil<InputRecord> util = new ExcelUtil<InputRecord>(InputRecord.class);
util.exportExcel(response, list, "综合查询--入库记录");
}
}

View File

@ -1,22 +1,25 @@
package com.bonus.sgzb.material.controller;
import com.bonus.sgzb.common.core.utils.poi.ExcelUtil;
import com.bonus.sgzb.common.core.web.controller.BaseController;
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
import com.bonus.sgzb.common.core.web.page.TableDataInfo;
import com.bonus.sgzb.common.log.annotation.Log;
import com.bonus.sgzb.common.log.enums.BusinessType;
import com.bonus.sgzb.material.domain.PurchaseCheckInfo;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.bonus.sgzb.common.security.utils.SecurityUtils;
import com.bonus.sgzb.material.domain.PurchaseInput;
import com.bonus.sgzb.material.service.IPurchaseCheckInfoService;
import com.bonus.sgzb.material.domain.PurchaseCheckInfo;
import com.bonus.sgzb.material.service.PurchaseCheckServiceCenterService;
import com.bonus.sgzb.material.vo.NoticeInfoVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import com.bonus.sgzb.common.log.annotation.Log;
import com.bonus.sgzb.common.log.enums.BusinessType;
import com.bonus.sgzb.common.core.web.controller.BaseController;
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
import com.bonus.sgzb.common.core.utils.poi.ExcelUtil;
import com.bonus.sgzb.common.core.web.page.TableDataInfo;
/**
* 新购验收任务
@ -32,15 +35,25 @@ public class PurchaseCheckInfoController extends BaseController
@Autowired
private IPurchaseCheckInfoService purchaseCheckInfoService;
@Autowired
private PurchaseCheckServiceCenterService purchaseCheckServiceCenterService;
/**
* 查询新购入库任务列表
*/
@ApiOperation("查询新购入库任务列表")
@GetMapping("/putInList")
public TableDataInfo putInList(PurchaseCheckInfo purchaseCheckInfo)
{
public TableDataInfo putInList(PurchaseCheckInfo purchaseCheckInfo) {
startPage();
List<PurchaseCheckInfo> list = purchaseCheckInfoService.selectPutInListList(purchaseCheckInfo);
List<PurchaseCheckInfo> list = new ArrayList<>();
//判断该组织是否开启综合服务中心审核
Long companyId = SecurityUtils.getLoginUser().getSysUser().getCompanyId();
int re = purchaseCheckServiceCenterService.selectExamineType(companyId);
if (re > 0) {
list = purchaseCheckInfoService.selectPutInListExamine(purchaseCheckInfo);
}else {
list = purchaseCheckInfoService.selectPutInListList(purchaseCheckInfo);
}
return getDataTable(list);
}

View File

@ -0,0 +1,94 @@
package com.bonus.sgzb.material.controller;
import com.bonus.sgzb.common.core.utils.poi.ExcelUtil;
import com.bonus.sgzb.common.core.web.controller.BaseController;
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
import com.bonus.sgzb.common.core.web.page.TableDataInfo;
import com.bonus.sgzb.common.log.annotation.Log;
import com.bonus.sgzb.common.log.enums.BusinessType;
import com.bonus.sgzb.common.security.utils.SecurityUtils;
import com.bonus.sgzb.material.domain.PurchaseCheckInfo;
import com.bonus.sgzb.material.domain.PurchaseInput;
import com.bonus.sgzb.material.domain.PurchaseMacodeInfo;
import com.bonus.sgzb.material.service.IPurchaseCheckInfoService;
import com.bonus.sgzb.material.service.PurchaseCheckServiceCenterService;
import com.bonus.sgzb.material.vo.MaInputVO;
import com.bonus.sgzb.material.vo.NoticeInfoVO;
import com.bonus.sgzb.system.api.domain.SysUser;
import com.bonus.sgzb.system.api.model.LoginUser;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
/**
* 新购--综合服务中心
*
* @author bonus
* @date 2023-12-10
*/
@RestController
@Api(value = "新购--综合服务中心")
@RequestMapping("/purchaseCheckServiceCenter")
public class PurchaseCheckServiceCenterController extends BaseController
{
@Autowired
private PurchaseCheckServiceCenterService purchaseCheckServiceCenterService;
/**
* 查询新购入库任务列表
*/
@ApiOperation("查询新购入库任务列表")
@GetMapping("/putInList")
public TableDataInfo putInList(PurchaseCheckInfo purchaseCheckInfo)
{
startPage();
List<PurchaseCheckInfo> list=new ArrayList<>();
//判断该组织是否开启综合服务中心审核
Long companyId = SecurityUtils.getLoginUser().getSysUser().getCompanyId();
int re =purchaseCheckServiceCenterService.selectExamineType(companyId);
if (re>0){
list = purchaseCheckServiceCenterService.selectPutInListList(purchaseCheckInfo);
}
return getDataTable(list);
}
/**
* 获取新购验收编号管理详细信息
*/
@ApiOperation(value = "新购入库清单明细")
@GetMapping(value = "/putinDetails")
public TableDataInfo putinDetails(PurchaseMacodeInfo purchaseMacodeInfo)
{
startPage();
return getDataTable(purchaseCheckServiceCenterService.selectPutinDetails(purchaseMacodeInfo));
}
/**
* 修改新购验收编号管理,暂时不用
*/
@ApiOperation(value = "修改编码管理的入库状态")
@PutMapping("/manageStatus")
public AjaxResult modifyManageStatus(@RequestBody MaInputVO maInputVO) throws Exception {
return toAjax(purchaseCheckServiceCenterService.modifyManageStatus(maInputVO));
}
/**
* 导出新购工机具入库
*/
@ApiOperation("导出新购工机具入库")
@Log(title = "导出新购工机具入库", businessType = BusinessType.EXPORT)
@PostMapping("/putInExport")
public void putInExport(HttpServletResponse response, PurchaseCheckInfo purchaseCheckInfo)
{
List<PurchaseInput> list = purchaseCheckServiceCenterService.putInExportList(purchaseCheckInfo);
ExcelUtil<PurchaseInput> util = new ExcelUtil<PurchaseInput>(PurchaseInput.class);
util.exportExcel(response, list, "新购工机具入库");
}
}

View File

@ -0,0 +1,219 @@
package com.bonus.sgzb.material.domain;
import com.bonus.sgzb.common.core.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
/**
* @description 综合查询--机具入库查询
* @author hay
* @date 2024/2/26 14:51
*/
@ApiModel(description = "机具入库查询")
@Data
public class InputRecord {
private static final long serialVersionUID = 2227217051604273598L;
@ApiModelProperty(value = "")
private Integer id;
/**
* 机具名称
*/
@ApiModelProperty(value = "机具名称")
@Excel(name = "机具名称")
private String typeName;
/**
* 规格ID
*/
@ApiModelProperty(value = "规格ID")
private Integer typeId;
/**
* 规格型号
*/
@ApiModelProperty(value = "规格型号")
@Excel(name = "规格型号")
private String typeModelName;
/**
* 二维码编号
*/
@ApiModelProperty(value = "二维码编号")
@Excel(name = "二维码编号")
private String qrCode;
/**
* 设备编码
*/
@ApiModelProperty(value = "设备编码")
@Excel(name = "设备编码")
private String maCode;
/**
* 单位
*/
@ApiModelProperty(value = "单位")
@Excel(name = "单位")
private String unit;
/**
* 入库数量
*/
@ApiModelProperty(value = "入库数量")
@Excel(name = "入库数量",cellType = Excel.ColumnType.NUMERIC)
private Double inputNum;
/**
* 创建时间
*/
@ApiModelProperty(value = "创建时间")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "入库时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
/**
* 入库人
*/
@ApiModelProperty(value = "入库人")
@Excel(name = "入库人")
private String userName;
/**
* 入库类型
*/
@ApiModelProperty(value = "入库类型")
@Excel(name = "入库类型")
private String inputType;
/**
* 单位Id
*/
@ApiModelProperty(value = "单位Id")
private Integer unitId;
/**
* 往来单位
*/
@ApiModelProperty(value = "往来单位")
private String unitName;
/**
* 工程Id
*/
@ApiModelProperty(value = "工程Id")
private Integer proId;
/**
* 工程名称
*/
@ApiModelProperty(value = "工程名称")
private String proName;
/**
* 报废单号
*/
@ApiModelProperty(value = "报废单号")
private String code;
/**
* 来源单号
*/
@ApiModelProperty(value = "来源单号")
private String sourceCode;
/**
* 协议号
*/
@ApiModelProperty(value = "协议号")
private String agreementCode;
/**
* 报废时间
*/
@ApiModelProperty(value = "报废时间")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date scrapTime;
/**
* 退料人
*/
@ApiModelProperty(value = "退料人")
private String backPerson;
/**
* 创建者
*/
@ApiModelProperty(value = "创建者")
private String createBy;
/**
* 更新者
*/
@ApiModelProperty(value = "更新者")
private String updateBy;
/**
* 更新时间
*/
@ApiModelProperty(value = "更新时间 ")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;
/**
* 报废原因
*/
@ApiModelProperty(value = "报废原因")
private String remark;
/**
* 关键字
*/
@ApiModelProperty(value = "关键字")
private String keyWord;
@ApiModelProperty(value="开始时间")
private String startTime;
@ApiModelProperty(value="结束时间")
private String endTime;
/**
* 设备所属类型
*/
@ApiModelProperty(value = "数据所属组织")
private Integer companyId;
/**
* 装备管理方式(0编号 1计数)
*/
@ApiModelProperty(value = "装备管理方式")
private int manageType;
/**
* 装备管理方式(0编号 1计数)
*/
@ApiModelProperty(value = "装备管理方式名称")
private String manageTypeName;
/**
* 实时库存
*/
@ApiModelProperty(value = "实时库存")
private Double num;
}

View File

@ -0,0 +1,23 @@
package com.bonus.sgzb.material.mapper;
import com.bonus.sgzb.material.domain.InputRecord;
import com.bonus.sgzb.material.domain.ScrapRecord;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* @description 综合查询--机具入库查询
* @author hay
* @date 2024/2/26 14:19
*/
@Mapper
public interface InputRecordMapper {
/**
* 综合查询--机具入库查询
* @param bean
* @return List<InputRecord>
*/
List<InputRecord> getInputRecordList(InputRecord bean);
}

View File

@ -142,4 +142,13 @@ public interface PurchaseCheckDetailsMapper {
* @return List<PurchaseCheckDetails>
*/
List<PurchaseCheckDetails> getAcceptanceForm(PurchaseCheckDetails purchaseCheckDetails);
/**
* 修改
* @param purchaseCheckDetails
* @return
*/
int updateStatusByTaskIdTypeId(PurchaseCheckDetails purchaseCheckDetails);
int updateByTaskId(@Param("taskId") Long taskId,@Param("typeId") Long typeId);
}

View File

@ -99,4 +99,11 @@ public interface PurchaseCheckInfoMapper
* @return
*/
List<PurchaseInput> putInExportList(PurchaseCheckInfo purchaseCheckInfo);
/**
* 查询
* @param purchaseCheckInfo
* @return
*/
List<PurchaseCheckInfo> selectPutInListExamine(PurchaseCheckInfo purchaseCheckInfo);
}

View File

@ -0,0 +1,209 @@
package com.bonus.sgzb.material.mapper;
import com.bonus.sgzb.base.api.domain.MaMachine;
import com.bonus.sgzb.base.api.domain.MaType;
import com.bonus.sgzb.material.domain.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 新购验收任务purchase_check_infoMapper接口
*
* @author bonus
* @date 2023-12-10
*/
@Mapper
public interface PurchaseCheckServiceCenterMapper
{
/**
* 查询新购验收任务purchase_check_info
*
* @param taskId 新购验收任务purchase_check_info主键
* @return 新购验收任务purchase_check_info
*/
public PurchaseCheckInfo selectPurchaseCheckInfoByTaskId(Long taskId);
/**
* 查询新购验收任务purchase_check_info列表
*
* @param purchaseCheckInfo 新购验收任务purchase_check_info
* @return 新购验收任务purchase_check_info集合
*/
public List<PurchaseCheckInfo> selectPurchaseCheckInfoList(PurchaseCheckInfo purchaseCheckInfo);
/**
* 新增新购验收任务purchase_check_info
*
* @param purchaseCheckInfo 新购验收任务purchase_check_info
* @return 结果
*/
public int insertPurchaseCheckInfo(PurchaseCheckInfo purchaseCheckInfo);
/**
* 修改新购验收任务purchase_check_info
*
* @param purchaseCheckInfo 新购验收任务purchase_check_info
* @return 结果
*/
public int updatePurchaseCheckInfo(PurchaseCheckInfo purchaseCheckInfo);
/**
* 删除新购验收任务purchase_check_info
*
* @param taskId 新购验收任务purchase_check_info主键
* @return 结果
*/
public int deletePurchaseCheckInfoByTaskId(Long taskId);
/**
* 批量删除新购验收任务purchase_check_info
*
* @param taskIds 需要删除的数据主键集合
* @return 结果
*/
public int deletePurchaseCheckInfoByTaskIds(Long[] taskIds);
/**
* 查询新购入库任务列表
* @param taskId
** @param type 1-验收2-入库
* @return
*/
String selectTypeNameByTaskId(@Param("taskId") Long taskId,@Param("type") String type);
/**
* 插入
* @param bmNoticeInfo
* @return
*/
int insertBmNoticeInfo(BmNoticeInfo bmNoticeInfo);
/**
* 查询
* @param purchaseCheckInfo
* @return
*/
List<PurchaseCheckInfo> selectPutInListList(PurchaseCheckInfo purchaseCheckInfo);
/**
* 新购验收
* @param purchaseCheckInfo
* @return
*/
List<PurchaseCheckInfo> exportList(PurchaseCheckInfo purchaseCheckInfo);
/**
* 新购入库导出
* @param purchaseCheckInfo
* @return
*/
List<PurchaseInput> putInExportList(PurchaseCheckInfo purchaseCheckInfo);
/**
* 获取入库清单明细
* @param purchaseMacodeInfo
* @return
*/
List<PurchaseMacodeInfo> selectPutinDetails(PurchaseMacodeInfo purchaseMacodeInfo);
/**
* 修改
* @param maMachine
* @return
*/
int updateMaMachine(MaMachine maMachine);
/**
* 查询
* @param typeId
* @return
*/
MaType selectTypeByTypeId(Long typeId);
/**
* 修改
* @param maType
* @return
*/
int updateTypeByTypeId(MaType maType);
/**
* 插入
* @param applyDetails
* @return
*/
int insertInputApplyDetails(InputApplyDetails applyDetails);
/**
* 修改
* @param purchaseMacodeInfo
* @return
*/
int updateMacodeByType(PurchaseMacodeInfo purchaseMacodeInfo);
/**
* 插入
* @param maInputRecord
* @return
*/
int insertMaInputRecord(MaInputRecord maInputRecord);
/**
* 删除ma_machine表
* @param maId
* @return 结果
*/
int deleteMaMachineInfoByMaId(Long maId);
/**
* 删除ma_machine_label表
* @param maId
* @return int
*/
int deleteMaMachineLabelByMaId(Long maId);
/**
* 删除ma_label_bind表
* @param maId
* @return int
*/
int deleteMaLabelBindByMaId(Long maId);
/**
* 删除purchase_macode_info表
* @param taskId
* @param typeId
* @param maCode
* @return
*/
int updatetePurchaseMaCodeInfoByMaCodeAndTaskIdAndTypeId(@Param("taskId") Long taskId,@Param("typeId") Long typeId,@Param("maCode") String maCode);
/**
* 当全部为已入库的时候任务改为入库状态
* @param taskId
* @return
*/
Integer selectMacodeInfoStatusByTaskId(Long taskId);
/**
* 查询组织是否开启审核
* @param companyId
* @return int
*/
int selectExamineType(Long companyId);
/**
* 判断是否全部已操作不通过或通过
* @param taskId
* @return int
*/
int isOperateAll(Long taskId);
/**
* 是否为全部不通过
* @param taskId
* @return
*/
int selectPurchaseCheckDetailsStatus(Long taskId);
}

View File

@ -100,4 +100,11 @@ public interface IPurchaseCheckInfoService
* @return
*/
PurchaseCheckInfo getAcceptanceForm(Long taskId, String keyWord);
/**
* 查询新购入库任务列表
* @param purchaseCheckInfo
* @return
*/
List<PurchaseCheckInfo> selectPutInListExamine(PurchaseCheckInfo purchaseCheckInfo);
}

View File

@ -0,0 +1,21 @@
package com.bonus.sgzb.material.service;
import com.bonus.sgzb.material.domain.InputRecord;
import com.bonus.sgzb.material.domain.ScrapRecord;
import java.util.List;
/**
* @description 综合查询--机具入库查询
* @author hay
* @date 2024/2/26 14:19
*/
public interface InputRecordService {
/**
* 综合查询--机具入库查询列表
* @param bean
* @return List<InputRecord>
*/
List<InputRecord> getInputRecordList(InputRecord bean);
}

View File

@ -0,0 +1,125 @@
package com.bonus.sgzb.material.service;
import com.bonus.sgzb.material.domain.PurchaseCheckInfo;
import com.bonus.sgzb.material.domain.PurchaseInput;
import com.bonus.sgzb.material.domain.PurchaseMacodeInfo;
import com.bonus.sgzb.material.vo.MaInputVO;
import com.bonus.sgzb.material.vo.NoticeInfoVO;
import java.util.List;
/**
* 新购验收任务purchase_check_infoService接口
*
* @author bonus
* @date 2023-12-10
*/
public interface PurchaseCheckServiceCenterService
{
/**
* 查询新购验收任务purchase_check_info
* @param taskId
* @param keyword
* @return
*/
public PurchaseCheckInfo selectPurchaseCheckInfoByTaskId(Long taskId,String keyword);
/**
* 查询新购验收任务purchase_check_info列表
*
* @param purchaseCheckInfo 新购验收任务purchase_check_info
* @return 新购验收任务purchase_check_info集合
*/
public List<PurchaseCheckInfo> selectPurchaseCheckInfoList(PurchaseCheckInfo purchaseCheckInfo);
/**
* 新增新购验收任务purchase_check_info
*
* @param purchaseCheckInfo 新购验收任务purchase_check_info
* @return 结果
*/
public int insertPurchaseCheckInfo(PurchaseCheckInfo purchaseCheckInfo);
/**
* 修改新购验收任务purchase_check_info
* @param purchaseCheckInfo
* @return
* @throws Exception
*/
public int updatePurchaseCheckInfo(PurchaseCheckInfo purchaseCheckInfo) throws Exception;
/**
* 批量删除新购验收任务purchase_check_info
*
* @param taskIds 需要删除的新购验收任务purchase_check_info主键集合
* @return 结果
*/
public int deletePurchaseCheckInfoByTaskIds(Long[] taskIds);
/**
* 删除新购验收任务purchase_check_info信息
*
* @param taskId 新购验收任务purchase_check_info主键
* @return 结果
*/
public int deletePurchaseCheckInfoByTaskId(Long taskId);
/**
* 验收通知
* @param noticeInfoVO
* @return
* @throws Exception
*/
Boolean insertBmNoticeInfo(NoticeInfoVO noticeInfoVO) throws Exception;
/**
* 查询新购入库任务列表
* @param purchaseCheckInfo
* @return
*/
List<PurchaseCheckInfo> selectPutInListList(PurchaseCheckInfo purchaseCheckInfo);
/**
* 新购工机具验收导出
* @param purchaseCheckInfo
* @return
*/
List<PurchaseCheckInfo> exportList(PurchaseCheckInfo purchaseCheckInfo);
/**
* 新购工机具入库导出
* @param purchaseCheckInfo
* @return
*/
List<PurchaseInput> putInExportList(PurchaseCheckInfo purchaseCheckInfo);
/**
* 获取新购验收任务--验收单
*
* @param taskId
* @param keyWord
* @return
*/
PurchaseCheckInfo getAcceptanceForm(Long taskId, String keyWord);
/**
* 新购入库清单明细
* @param purchaseMacodeInfo
* @return List<PurchaseMacodeInfo>
*/
List<PurchaseMacodeInfo> selectPutinDetails(PurchaseMacodeInfo purchaseMacodeInfo);
/**
* 修改编码管理的入库状态
* @param maInputVO
* @return
*/
int modifyManageStatus(MaInputVO maInputVO);
/**
* 查询组织是否开启审核
* @param companyId
* @return int
*/
int selectExamineType(Long companyId);
}

View File

@ -0,0 +1,29 @@
package com.bonus.sgzb.material.service.impl;
import com.bonus.sgzb.material.domain.InputRecord;
import com.bonus.sgzb.material.domain.ScrapRecord;
import com.bonus.sgzb.material.mapper.InputRecordMapper;
import com.bonus.sgzb.material.mapper.ScrapRecordMapper;
import com.bonus.sgzb.material.service.InputRecordService;
import com.bonus.sgzb.material.service.ScrapRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @author hay
* @date 2023/12/20 14:55
*/
@Service
public class InputRecordServiceImpl implements InputRecordService {
@Autowired
private InputRecordMapper inputRecordMapper;
@Override
public List<InputRecord> getInputRecordList(InputRecord bean) {
return inputRecordMapper.getInputRecordList(bean);
}
}

View File

@ -96,6 +96,16 @@ public class PurchaseCheckInfoServiceImpl implements IPurchaseCheckInfoService {
return purchaseCheckInfo;
}
@Override
public List<PurchaseCheckInfo> selectPutInListExamine(PurchaseCheckInfo purchaseCheckInfo) {
List<PurchaseCheckInfo> purchaseCheckInfos = purchaseCheckInfoMapper.selectPutInListExamine(purchaseCheckInfo);
for (PurchaseCheckInfo checkInfo : purchaseCheckInfos) {
String typeName = purchaseCheckInfoMapper.selectTypeNameByTaskId(checkInfo.getTaskId(),"3");
checkInfo.setPurchasingTypeName(typeName);
}
return purchaseCheckInfos;
}
/**
* 查询新购验收任务列表
*

View File

@ -0,0 +1,356 @@
package com.bonus.sgzb.material.service.impl;
import com.bonus.sgzb.base.api.domain.MaMachine;
import com.bonus.sgzb.base.api.domain.MaType;
import com.bonus.sgzb.common.core.utils.DateUtils;
import com.bonus.sgzb.common.security.utils.SecurityUtils;
import com.bonus.sgzb.material.domain.*;
import com.bonus.sgzb.material.mapper.PurchaseCheckDetailsMapper;
import com.bonus.sgzb.material.mapper.PurchaseCheckInfoMapper;
import com.bonus.sgzb.material.mapper.PurchaseCheckServiceCenterMapper;
import com.bonus.sgzb.material.mapper.TaskMapper;
import com.bonus.sgzb.material.service.IPurchaseCheckInfoService;
import com.bonus.sgzb.material.service.PurchaseCheckServiceCenterService;
import com.bonus.sgzb.material.vo.GlobalContants;
import com.bonus.sgzb.material.vo.MaInputVO;
import com.bonus.sgzb.material.vo.NoticeInfoVO;
import com.bonus.sgzb.system.api.RemoteUserService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
* 新购验收任务Service业务层处理
*
* @author bonus
* @date 2023-12-10
*/
@Service
public class PurchaseCheckServiceCenterServiceImpl implements PurchaseCheckServiceCenterService {
@Resource
private PurchaseCheckServiceCenterMapper purchaseCheckServiceCenterMapper;
@Resource
private TaskMapper taskMapper;
@Resource
private PurchaseCheckDetailsMapper purchaseCheckDetailsMapper;
@Resource
private PurchaseCheckDetailsMapper checkDetailsMapper;
@Resource
private RemoteUserService remoteUserService;
/**
* 查询新购验收任务
*
* @param taskId 新购验收任务主键
* @param keyword 关键字筛选
* @return 新购验收任务
*/
@Override
public PurchaseCheckInfo selectPurchaseCheckInfoByTaskId(Long taskId, String keyword) {
PurchaseCheckInfo purchaseCheckInfo = purchaseCheckServiceCenterMapper.selectPurchaseCheckInfoByTaskId(taskId);
PurchaseCheckDetails purchaseCheckDetails = new PurchaseCheckDetails();
purchaseCheckDetails.setTaskId(purchaseCheckInfo.getTaskId());
purchaseCheckDetails.setKeyWord(keyword);
List<PurchaseCheckDetails> purchaseCheckDetailsList = purchaseCheckDetailsMapper.selectPurchaseCheckDetailsList(purchaseCheckDetails);
purchaseCheckInfo.setCheckDetailsList(purchaseCheckDetailsList);
return purchaseCheckInfo;
}
/**
* 查询新购入库任务列表
*
* @param purchaseCheckInfo 新购入库任务
* @return 新购入库任务
*/
@Override
public List<PurchaseCheckInfo> selectPutInListList(PurchaseCheckInfo purchaseCheckInfo) {
List<PurchaseCheckInfo> purchaseCheckInfos = purchaseCheckServiceCenterMapper.selectPutInListList(purchaseCheckInfo);
for (PurchaseCheckInfo checkInfo : purchaseCheckInfos) {
String typeName = purchaseCheckServiceCenterMapper.selectTypeNameByTaskId(checkInfo.getTaskId(),"2");
checkInfo.setPurchasingTypeName(typeName);
}
return purchaseCheckInfos;
}
/**
* 获取入库清单明细
*
* @param purchaseMacodeInfo 查询条件
* @return 结果
*/
@Override
public List<PurchaseMacodeInfo> selectPutinDetails(PurchaseMacodeInfo purchaseMacodeInfo) {
return purchaseCheckServiceCenterMapper.selectPutinDetails(purchaseMacodeInfo);
}
@Override
public List<PurchaseCheckInfo> exportList(PurchaseCheckInfo purchaseCheckInfo) {
return purchaseCheckServiceCenterMapper.exportList(purchaseCheckInfo);
}
@Override
public List<PurchaseInput> putInExportList(PurchaseCheckInfo purchaseCheckInfo) {
return purchaseCheckServiceCenterMapper.putInExportList(purchaseCheckInfo);
}
/**
* 新购验收单
*/
@Override
public PurchaseCheckInfo getAcceptanceForm(Long taskId, String keyword) {
PurchaseCheckInfo purchaseCheckInfo = purchaseCheckServiceCenterMapper.selectPurchaseCheckInfoByTaskId(taskId);
PurchaseCheckDetails purchaseCheckDetails = new PurchaseCheckDetails();
purchaseCheckDetails.setTaskId(purchaseCheckInfo.getTaskId());
purchaseCheckDetails.setKeyWord(keyword);
List<PurchaseCheckDetails> purchaseCheckDetailsList = purchaseCheckDetailsMapper.getAcceptanceForm(purchaseCheckDetails);
purchaseCheckInfo.setCheckDetailsList(purchaseCheckDetailsList);
return purchaseCheckInfo;
}
/**
* 查询新购验收任务列表
*
* @param purchaseCheckInfo 新购验收任务
* @return 新购验收任务
*/
@Override
public List<PurchaseCheckInfo> selectPurchaseCheckInfoList(PurchaseCheckInfo purchaseCheckInfo) {
List<PurchaseCheckInfo> purchaseCheckInfos = purchaseCheckServiceCenterMapper.selectPurchaseCheckInfoList(purchaseCheckInfo);
for (PurchaseCheckInfo checkInfo : purchaseCheckInfos) {
String typeName = purchaseCheckServiceCenterMapper.selectTypeNameByTaskId(checkInfo.getTaskId(),"1");
checkInfo.setPurchasingTypeName(typeName);
}
return purchaseCheckInfos;
}
/**
* 修改编码管理的入库状态,暂时不用
*
* @param maInputVO 入库信息
* @return 结果
*/
@Override
public int modifyManageStatus(MaInputVO maInputVO) {
Long taskId = maInputVO.getTaskId();
String checkResult = maInputVO.getCheckResult();
List<MaInputRecord> inputRecordList = maInputVO.getInputRecordList();
for (MaInputRecord maInputRecord : inputRecordList) {
Long typeId = maInputRecord.getTypeId();
//修改编码管理表入库状态
PurchaseMacodeInfo purchaseMacodeInfo = new PurchaseMacodeInfo();
purchaseMacodeInfo.setTaskId(taskId);
purchaseMacodeInfo.setTypeId(typeId);
purchaseMacodeInfo.setMaCode(maInputRecord.getMaCode());
// 修改验收任务详细表入库数量
if ("1".equals(checkResult)) {
//修改机具状态为在库
PurchaseCheckDetails purchaseCheckDetails = new PurchaseCheckDetails();
purchaseCheckDetails.setStatus(6);
purchaseCheckDetails.setTaskId(taskId);
purchaseCheckDetails.setTypeId(typeId);
checkDetailsMapper.updateStatusByTaskIdTypeId(purchaseCheckDetails);
}else {
//删除ma_machine表
purchaseCheckServiceCenterMapper.deleteMaMachineInfoByMaId(maInputRecord.getMaId());
//删除ma_machine_label表
purchaseCheckServiceCenterMapper.deleteMaMachineLabelByMaId(maInputRecord.getMaId());
//删除ma_label_bind表
purchaseCheckServiceCenterMapper.deleteMaLabelBindByMaId(maInputRecord.getMaId());
//修改purchase_macode_info表
purchaseCheckServiceCenterMapper.updatetePurchaseMaCodeInfoByMaCodeAndTaskIdAndTypeId(taskId,typeId,maInputRecord.getMaCode());
//修改purchase_check_details表
checkDetailsMapper.updateByTaskId(taskId,typeId);
}
}
//判断是否全部已操作通过或不通过
int count=purchaseCheckServiceCenterMapper.isOperateAll(taskId);
if (count<=0) {
//是否为全部不通过
int count1 = purchaseCheckServiceCenterMapper.selectPurchaseCheckDetailsStatus(taskId);
if (count1 <= 0) {
//是则将任务状态改为验收不通过
TmTask task = new TmTask();
task.setTaskId(taskId);
task.setTaskStatus(106);
task.setUpdateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
task.setUpdateTime(DateUtils.getNowDate());
taskMapper.updateTmTask(task);
} else {
// 当全部操作,修改任务为验收状态
TmTask task = new TmTask();
task.setTaskId(taskId);
task.setTaskStatus(105);
task.setUpdateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
task.setUpdateTime(DateUtils.getNowDate());
taskMapper.updateTmTask(task);
}
}
return 1;
}
@Override
public int selectExamineType(Long companyId) {
return purchaseCheckServiceCenterMapper.selectExamineType(companyId);
}
/**
* 新增新购验收任务
*
* @param purchaseCheckInfo 新购验收任务
* @return 结果
*/
@Override
@Transactional(rollbackFor = Exception.class)
public int insertPurchaseCheckInfo(PurchaseCheckInfo purchaseCheckInfo) {
TmTask task = new TmTask();
// 暂定的状态字典表
task.setTaskType(23);
task.setTaskStatus(24);
// 采购单号
task.setCode(purchaseCodeRule());
task.setCreateTime(DateUtils.getNowDate());
task.setCompanyId(purchaseCheckInfo.getCompanyId());
task.setCreateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
// 创建任务信息
taskMapper.insertTmTask(task);
purchaseCheckInfo.setTaskId(task.getTaskId());
purchaseCheckInfo.setCreateTime(DateUtils.getNowDate());
// 批量新增新购任务详情信息
List<PurchaseCheckDetails> checkDetailsList = purchaseCheckInfo.getCheckDetailsList();
if (checkDetailsList != null) {
for (PurchaseCheckDetails purchaseCheckDetails : checkDetailsList) {
purchaseCheckDetails.setTaskId(task.getTaskId());
purchaseCheckDetails.setStatus(2);
}
purchaseCheckDetailsMapper.insertPurchaseCheckDetailsList(checkDetailsList);
}
// 新增任务信息
return purchaseCheckServiceCenterMapper.insertPurchaseCheckInfo(purchaseCheckInfo);
}
/**采购单号编码生成规则*/
private String purchaseCodeRule() {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
Date nowDate = DateUtils.getNowDate();
String format = dateFormat.format(nowDate);
int taskNum = taskMapper.selectTaskNumByMonth(nowDate, 23) + 1;
String code = "";
if (taskNum > GlobalContants.NUM1 && taskNum < GlobalContants.NUM2) {
code = "XG" + format + "-00" + taskNum;
} else if (taskNum > GlobalContants.NUM3 && taskNum < GlobalContants.NUM4) {
code = "XG" + format + "-0" + taskNum;
} else {
code = "XG" + format + "-000" + taskNum;
}
return code;
}
/**
* 修改新购验收任务
*
* @param purchaseCheckInfo 新购验收任务
* @return 结果
*/
@Override
@Transactional(rollbackFor = Exception.class)
public int updatePurchaseCheckInfo(PurchaseCheckInfo purchaseCheckInfo) throws Exception {
Long taskId = purchaseCheckInfo.getTaskId();
TmTask task = taskMapper.selectTmTaskByTaskId(taskId);
// 判断当前任务是否为待通知状态
if (task == null || task.getTaskStatus() != GlobalContants.NUM6) {
throw new Exception("当前任务不可修改!!!");
}
// 批量新增新购任务详情信息
List<PurchaseCheckDetails> checkDetailsList = purchaseCheckInfo.getCheckDetailsList();
if (checkDetailsList != null) {
// 先删除全部的任务详情信息
purchaseCheckDetailsMapper.deleteCheckDetailsByTaskId(taskId);
for (PurchaseCheckDetails purchaseCheckDetails : checkDetailsList) {
purchaseCheckDetails.setTaskId(taskId);
purchaseCheckDetails.setStatus(2);
}
// 添加任务详情信息
purchaseCheckDetailsMapper.insertPurchaseCheckDetailsList(checkDetailsList);
}
purchaseCheckInfo.setUpdateTime(DateUtils.getNowDate());
return purchaseCheckServiceCenterMapper.updatePurchaseCheckInfo(purchaseCheckInfo);
}
/**
* 批量删除新购验收任务
*
* @param taskIds 需要删除的新购验收任务主键
* @return 结果
*/
@Override
public int deletePurchaseCheckInfoByTaskIds(Long[] taskIds) {
return purchaseCheckServiceCenterMapper.deletePurchaseCheckInfoByTaskIds(taskIds);
}
/**
* 删除新购验收任务信息
*
* @param taskId 新购验收任务主键
* @return 结果
*/
@Override
public int deletePurchaseCheckInfoByTaskId(Long taskId) {
return purchaseCheckServiceCenterMapper.deletePurchaseCheckInfoByTaskId(taskId);
}
/**
* 验收通知
*
* @param noticeInfoVO 验收通知内容
* @return 结果
*/
@Override
public Boolean insertBmNoticeInfo(NoticeInfoVO noticeInfoVO) throws Exception {
// 任务状态修改
TmTask task = new TmTask();
Long taskId = noticeInfoVO.getTaskId();
if (taskId == null) {
throw new Exception("任务taskId为空!!");
}
TmTask task1 = taskMapper.selectTmTaskByTaskId(taskId);
if (task1.getTaskStatus() != GlobalContants.NUM6) {
throw new Exception("任务状态不为待通知!!");
}
task.setTaskId(taskId);
task.setTaskStatus(25);
taskMapper.updateTmTask(task);
// 修改任务详情状态
purchaseCheckDetailsMapper.updateCheckDetailsByTaskId(taskId);
String message = noticeInfoVO.getMessage();
List<BmNoticeInfo> bmNoticeInfoList = noticeInfoVO.getBmNoticeInfoList();
if (bmNoticeInfoList.size() <= 0) {
throw new Exception("绑定用户为空");
}
Boolean send = true;
for (BmNoticeInfo bmNoticeInfo : bmNoticeInfoList) {
bmNoticeInfo.setContent(message);
bmNoticeInfo.setTaskId(taskId);
bmNoticeInfo.setModelName("新购机具验收");
bmNoticeInfo.setCreateTime(new Date());
String phone = bmNoticeInfo.getPhone();
// 短信通知
send = remoteUserService.send(phone, message);
purchaseCheckServiceCenterMapper.insertBmNoticeInfo(bmNoticeInfo);
}
return send;
}
}

View File

@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bonus.sgzb.material.mapper.InputRecordMapper">
<select id="getInputRecordList" resultType="com.bonus.sgzb.material.domain.InputRecord">
SELECT mt2.type_name as typeName,
mt.type_name as typeModelName,
mm.qr_code as qrCode,
mm.ma_code as maCode,
mt.unit_name as unit,
iad.input_num as inputNum,
iad.create_time as createTime,
su.user_name as userName,
CASE iad.input_type
WHEN 1 THEN
'新购入库'
WHEN 2 THEN
'退料入库'
WHEN 3 THEN
'修试后入库'
WHEN 4 THEN
'盘点入库'
ELSE
''
END inputType
FROM input_apply_details iad
LEFT JOIN ma_type mt on mt.type_id = iad.type_id
LEFT JOIN ma_type mt2 on mt2.type_id = mt.parent_id
LEFT JOIN ma_machine mm on mm.ma_id = iad.ma_id
LEFT JOIN sys_user su on su.user_id = iad.create_by
where 1 = 1
<if test="keyWord != null and keyWord != ''">
and (mt2.type_name like concat('%',#{keyWord},'%') or
mt.type_name like concat('%',#{keyWord},'%') or
mm.ma_code like concat('%',#{keyWord},'%') or
mt.unit_name like concat('%',#{keyWord},'%') or
su.user_name like concat('%',#{keyWord},'%') or
mm.qr_code like concat('%',#{keyWord},'%'))
</if>
<if test="typeName != null and typeName != ''">
and mt2.type_name like concat('%',#{typeName},'%')
</if>
<if test="typeModelName != null and typeModelName != ''">
and mt.type_name like concat('%',#{typeModelName},'%')
</if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND iad.create_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59')
</if>
</select>
</mapper>

View File

@ -259,4 +259,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update id="updatePurchaseCheckDetailsByTaskId">
update purchase_check_details set bind_num = bind_num - 1 , status='5' where task_id = #{taskId} and type_id = #{typeId}
</update>
<update id="updateStatusByTaskIdTypeId">
update purchase_check_details set status = #{status} where task_id = #{taskId} and type_id = #{typeId}
</update>
<update id="updateByTaskId">
update purchase_check_details set bind_num = bind_num - 1 , status='7' where task_id = #{taskId} and type_id = #{typeId}
</update>
</mapper>

View File

@ -128,6 +128,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join ma_type mt1 on mt.parent_id = mt1.type_id
where pcd.task_id = #{taskId}
<if test="type == 2">and pcd.`status`!=3</if>
<if test="type == 3">and pcd.`status`!=3 and pcd.`status` !=7</if>
) t
GROUP BY task_id
</select>
@ -251,4 +252,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="companyId != null "> and pci.company_id = #{companyId}</if>
ORDER BY pcd.task_id desc
</select>
<select id="selectPutInListExamine" resultType="com.bonus.sgzb.material.domain.PurchaseCheckInfo">
select pci.id,pci.task_id, pci.purchase_time, pci.arrival_time, pci.purchaser, pci.create_by, pci.create_time, pci.update_by,
pci.update_time, pci.remark, pci.company_id ,dict.name purchasingStatus,tk.code,tk.task_status taskStatus,su.user_name purchaserName,
tk.create_by,
CASE tk.task_status
WHEN 28 THEN
tk.update_time
ELSE
''
END as inputTime,
CASE tk.task_status
WHEN 28 THEN
us.user_name
ELSE
''
END as inputUser
from purchase_check_info pci
left join tm_task tk on pci.task_id = tk.task_id
left join (select id,name from sys_dic where p_id = 50) dict on tk.task_status = dict.id
left join sys_user su on pci.purchaser = su.user_id
LEFT JOIN sys_user us on us.user_id = tk.update_by
where task_type = 23 and tk.task_status in (105,28)
<if test="keyWord != null and keyWord != ''"> and tk.code like concat('%',#{keyWord},'%')</if>
<if test="purchaseTime != null and purchaseTime != ''"> and pci.purchase_time = #{purchaseTime}</if>
<if test="arrivalTime != null and arrivalTime != ''"> and pci.arrival_time = #{arrivalTime}</if>
<if test="purchaser != null "> and pci.purchaser = #{purchaser}</if>
<if test="companyId != null "> and pci.company_id = #{companyId}</if>
order by pci.id desc
</select>
</mapper>

View File

@ -0,0 +1,439 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bonus.sgzb.material.mapper.PurchaseCheckServiceCenterMapper">
<resultMap type="com.bonus.sgzb.material.domain.PurchaseCheckInfo" id="PurchaseCheckInfoResult">
<result property="id" column="id" />
<result property="taskId" column="task_id" />
<result property="purchaseTime" column="purchase_time" />
<result property="arrivalTime" column="arrival_time" />
<result property="purchaser" column="purchaser" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
<result property="companyId" column="company_id" />
</resultMap>
<sql id="selectPurchaseCheckInfoVo">
select id,task_id, purchase_time, arrival_time, purchaser, create_by, create_time, update_by, update_time, remark, company_id from purchase_check_info
</sql>
<select id="selectPurchaseCheckInfoList" parameterType="com.bonus.sgzb.material.domain.PurchaseCheckInfo" resultMap="PurchaseCheckInfoResult">
select pci.id,pci.task_id, pci.purchase_time, pci.arrival_time, pci.purchaser, pci.create_by, pci.create_time,
pci.update_by,
pci.update_time, pci.remark, pci.company_id ,dict.name purchasingStatus,tk.code,su.user_name
purchaserName,tk.task_status taskStatus
from purchase_check_info pci
left join tm_task tk on pci.task_id = tk.task_id
left join (select id,name from sys_dic where p_id = 23) dict on tk.task_status = dict.id
left join sys_user su on pci.purchaser = su.user_id
LEFT JOIN purchase_check_details pcd on pcd.task_id=pci.task_id
where task_type = 23
<if test="keyWord != null and keyWord != ''">
and (tk.code like concat('%',#{keyWord},'%') or
su.user_name like concat('%',#{keyWord},'%')
)
</if>
<if test="purchaseTime != null and purchaseTime != ''">and pci.purchase_time = #{purchaseTime}</if>
<if test="arrivalTime != null and arrivalTime != ''">and pci.arrival_time = #{arrivalTime}</if>
<if test="purchaser != null ">and pci.purchaser = #{purchaser}</if>
<if test="companyId != null ">and pci.company_id = #{companyId}</if>
<if test="typeId != null">AND #{typeId} IN (SELECT mt2.type_id
FROM purchase_check_details pcd
LEFT JOIN ma_type mt on mt.type_id=pcd.type_id
LEFT JOIN ma_type mt2 on mt2.type_id=mt.parent_id
WHERE pcd.task_id = pci.task_id
)
</if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND ((pci.purchase_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59'))
or (pci.arrival_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59')))
</if>
GROUP BY pcd.task_id
order by pci.create_time desc
</select>
<select id="selectPurchaseCheckInfoByTaskId" parameterType="Long" resultMap="PurchaseCheckInfoResult">
select pci.id,pci.task_id, pci.purchase_time, pci.arrival_time, pci.purchaser, pci.create_by, pci.create_time,
pci.update_by, pci.update_time, pci.remark, pci.company_id, tk.code
from purchase_check_info pci
left join tm_task tk on pci.task_id = tk.task_id
where pci.task_id = #{taskId}
</select>
<insert id="insertPurchaseCheckInfo" parameterType="com.bonus.sgzb.material.domain.PurchaseCheckInfo" useGeneratedKeys="true" keyProperty="taskId">
insert into purchase_check_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="taskId != null">task_id,</if>
<if test="purchaseTime != null and purchaseTime != ''">purchase_time,</if>
<if test="arrivalTime != null">arrival_time,</if>
<if test="purchaser != null">purchaser,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
<if test="companyId != null">company_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="taskId != null">#{taskId},</if>
<if test="purchaseTime != null and purchaseTime != ''">#{purchaseTime},</if>
<if test="arrivalTime != null">#{arrivalTime},</if>
<if test="purchaser != null">#{purchaser},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
<if test="companyId != null">#{companyId},</if>
</trim>
</insert>
<update id="updatePurchaseCheckInfo" parameterType="com.bonus.sgzb.material.domain.PurchaseCheckInfo">
update purchase_check_info
<trim prefix="SET" suffixOverrides=",">
<if test="purchaseTime != null and purchaseTime != ''">purchase_time = #{purchaseTime},</if>
<if test="arrivalTime != null">arrival_time = #{arrivalTime},</if>
<if test="purchaser != null">purchaser = #{purchaser},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="companyId != null">company_id = #{companyId},</if>
</trim>
where task_id = #{taskId}
</update>
<update id="updateMaMachine">
update ma_machine set ma_status = #{maStatus} where ma_id = #{maId}
</update>
<update id="updateTypeByTypeId">
update ma_type set num = #{num} where type_id = #{typeId}
</update>
<update id="updateMacodeByType">
update purchase_macode_info
set status = #{status}
where task_id = #{taskId}
and type_id = #{typeId}
and ma_code = #{maCode}
</update>
<update id="updatetePurchaseMaCodeInfoByMaCodeAndTaskIdAndTypeId">
update
purchase_macode_info
set status='2'
where ma_code = #{maCode}
and task_id = #{taskId}
and type_id = #{typeId}
</update>
<delete id="deletePurchaseCheckInfoByTaskId" parameterType="Long">
delete from purchase_check_info where task_id = #{taskId}
</delete>
<delete id="deletePurchaseCheckInfoByTaskIds" parameterType="String">
delete from purchase_check_info where task_id in
<foreach item="taskId" collection="array" open="(" separator="," close=")">
#{taskId}
</foreach>
</delete>
<delete id="deleteMaMachineInfoByMaId">
delete from ma_machine where ma_id = #{maId}
</delete>
<delete id="deleteMaMachineLabelByMaId">
delete from ma_machine_label where ma_id = #{maId}
</delete>
<delete id="deleteMaLabelBindByMaId">
delete from ma_label_bind where ma_id = #{maId}
</delete>
<select id="selectTypeNameByTaskId" resultType="java.lang.String">
select GROUP_CONCAT(type_name) typeName from
(select distinct pcd.task_id, mt1.type_name
from purchase_check_details pcd
left join ma_type mt on pcd.type_id = mt.type_id
left join ma_type mt1 on mt.parent_id = mt1.type_id
where pcd.task_id = #{taskId}
<if test="type == 2">and pcd.`status`!=3</if>
) t
GROUP BY task_id
</select>
<insert id="insertBmNoticeInfo" parameterType="com.bonus.sgzb.material.domain.BmNoticeInfo" useGeneratedKeys="true" keyProperty="id">
insert into bm_notice_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="taskId != null">task_id,</if>
<if test="content != null and content != ''">content,</if>
<if test="noticeUser != null">notice_user,</if>
<if test="phone != null">phone,</if>
<if test="modelName != null">model_name,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
<if test="companyId != null">company_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="taskId != null">#{taskId},</if>
<if test="content != null and content != ''">#{content},</if>
<if test="noticeUser != null">#{noticeUser},</if>
<if test="phone != null">#{phone},</if>
<if test="modelName != null">#{modelName},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
<if test="companyId != null">#{companyId},</if>
</trim>
</insert>
<insert id="insertInputApplyDetails">
insert into input_apply_details
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="taskId != null">task_id,</if>
<if test="maId != null">ma_id,</if>
<if test="typeId != null">type_id,</if>
<if test="parentId != null">parent_id,</if>
<if test="inputNum != null">input_num,</if>
<if test="inputType != null">input_type,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
<if test="companyId != null">company_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="taskId != null">#{taskId},</if>
<if test="maId != null">#{maId},</if>
<if test="typeId != null">#{typeId},</if>
<if test="parentId != null">#{parentId},</if>
<if test="inputNum != null">#{inputNum},</if>
<if test="inputType != null">#{inputType},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
<if test="companyId != null">#{companyId},</if>
</trim>
</insert>
<insert id="insertMaInputRecord">
insert into ma_input_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="taskId != null">task_id,</if>
<if test="typeId != null">type_id,</if>
<if test="maId != null">ma_id,</if>
<if test="inputType != null">input_type,</if>
<if test="inputNum != null">input_num,</if>
<if test="status != null">status,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
<if test="companyId != null">company_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="taskId != null">#{taskId},</if>
<if test="typeId != null">#{typeId},</if>
<if test="maId != null">#{maId},</if>
<if test="inputType != null">#{inputType},</if>
<if test="inputNum != null">#{inputNum},</if>
<if test="status != null">#{status},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
<if test="companyId != null">#{companyId},</if>
</trim>
</insert>
<select id="selectPutInListList" resultMap="PurchaseCheckInfoResult">
select pci.id,pci.task_id, pci.purchase_time, pci.arrival_time, pci.purchaser, pci.create_time, pci.update_by,
pci.update_time, pci.remark, pci.company_id ,dict.name purchasingStatus,tk.code,tk.task_status taskStatus,su.user_name purchaserName,
tk.create_by,
CASE tk.task_status
WHEN 28 THEN
tk.update_time
ELSE
''
END as inputTime,
CASE tk.task_status
WHEN 28 THEN
us.user_name
ELSE
''
END as inputUser
from purchase_check_info pci
left join tm_task tk on pci.task_id = tk.task_id
left join (select id,name from sys_dic where p_id = 50) dict on tk.task_status = dict.id
left join sys_user su on pci.purchaser = su.user_id
LEFT JOIN sys_user us on us.user_id = tk.update_by
LEFT JOIN purchase_check_details pcd on pcd.task_id=pci.task_id
where task_type = 23 and tk.task_status in (26,28,105,106)
<if test="keyWord != null and keyWord != ''">
and (tk.code like concat('%',#{keyWord},'%') or
su.user_name like concat('%',#{keyWord},'%')
)
</if>
<if test="purchaseTime != null and purchaseTime != ''"> and pci.purchase_time = #{purchaseTime}</if>
<if test="arrivalTime != null and arrivalTime != ''"> and pci.arrival_time = #{arrivalTime}</if>
<if test="purchaser != null "> and pci.purchaser = #{purchaser}</if>
<if test="companyId != null "> and pci.company_id = #{companyId}</if>
<if test="typeId != null">AND #{typeId} IN (SELECT mt2.type_id
FROM purchase_check_details pcd
LEFT JOIN ma_type mt on mt.type_id=pcd.type_id
LEFT JOIN ma_type mt2 on mt2.type_id=mt.parent_id
WHERE pcd.task_id = pci.task_id
)
</if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND ((pci.purchase_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59'))
or (pci.arrival_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59')))
</if>
GROUP BY pcd.task_id
order by pci.id desc
</select>
<select id="exportList" resultType="com.bonus.sgzb.material.domain.PurchaseCheckInfo">
SELECT
tk.CODE,
pci.purchase_time as purchaseTime,
pci.arrival_time as arrivalTime,
su.user_name purchaserName,
mt1.type_name as purchasingTypeName,
mt.type_name AS purchasingTypeCode,
mt.manage_type as manageType,
msi.supplier,
pcd.purchase_num as purchaseNum,
pcd.check_num as checkNum,
dict.NAME AS purchasingStatus,
tk.task_status as taskStatus
FROM
purchase_check_details pcd
LEFT JOIN purchase_check_info pci ON pci.task_id = pcd.task_id
LEFT JOIN tm_task tk ON pci.task_id = tk.task_id
LEFT JOIN ( SELECT id, NAME FROM sys_dic WHERE p_id = 23 ) dict ON tk.task_status = dict.id
LEFT JOIN sys_user su ON pci.purchaser = su.user_id
LEFT JOIN ma_type mt ON pcd.type_id = mt.type_id
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
LEFT JOIN ma_supplier_info msi ON msi.supplier_id = pcd.supplier_id
WHERE
task_type = 23
<if test="keyWord != null and keyWord != ''"> and tk.code like concat('%',#{keyWord},'%')</if>
<if test="purchaseTime != null and purchaseTime != ''"> and pci.purchase_time = #{purchaseTime}</if>
<if test="arrivalTime != null and arrivalTime != ''"> and pci.arrival_time = #{arrivalTime}</if>
<if test="purchaser != null "> and pci.purchaser = #{purchaser}</if>
<if test="companyId != null "> and pci.company_id = #{companyId}</if>
ORDER BY
pcd.task_id DESC
</select>
<select id="putInExportList" resultType="com.bonus.sgzb.material.domain.PurchaseInput">
SELECT pcd.task_id as taskId,
tk.`code`,
pci.purchase_time as purchaseTime,
pci.arrival_time as arrivalTime,
pci.purchaser,
su.user_name purchaserName,
mt1.type_name as purchasingTypeName,
mt.type_name as purchasingTypeCode,
pcd.input_time as inputTime,
su.user_name as inputUser,
pcd.input_status as inputStatus
FROM purchase_check_details pcd
LEFT JOIN purchase_check_info pci on pci.task_id = pcd.task_id
left join tm_task tk on pcd.task_id = tk.task_id
left join sys_user su on pci.purchaser = su.user_id
left join ma_type mt on pcd.type_id = mt.type_id
left join ma_type mt1 on mt.parent_id = mt1.type_id
where task_type = 23
and tk.task_status in (26, 28)
<if test="keyWord != null and keyWord != ''"> and tk.code like concat('%',#{keyWord},'%')</if>
<if test="purchaseTime != null and purchaseTime != ''"> and pci.purchase_time = #{purchaseTime}</if>
<if test="arrivalTime != null and arrivalTime != ''"> and pci.arrival_time = #{arrivalTime}</if>
<if test="purchaser != null "> and pci.purchaser = #{purchaser}</if>
<if test="companyId != null "> and pci.company_id = #{companyId}</if>
ORDER BY pcd.task_id desc
</select>
<select id="selectPutinDetails" resultType="com.bonus.sgzb.material.domain.PurchaseMacodeInfo">
select pcd.production_time productionTime,
mt.type_name specificationType,
mt1.type_name typeName,
pmi.ma_code maCode,
mm.assets_code assetsCode,
pmi.fix_code fixCode,
pcd.type_id typeId,
pcd.task_id taskId,
mt.code specsCode,
mt1.code typeCode,
CASE
WHEN pmi.ma_code is null THEN
CASE
WHEN pcd.status = 4 THEN 1
WHEN pcd.status = 5 THEN 2
WHEN pcd.status = 6 THEN 3
WHEN pcd.status = 7 THEN 4
ELSE 0
END
ELSE pmi.status
END AS status,
mm.qr_code qrCode,
mm.ma_id maId,
if(pmi.ma_code is not null, 1, pcd.check_num) checkNum
from purchase_check_details pcd
left join purchase_macode_info pmi on pmi.task_id = pcd.task_id and pmi.type_id = pcd.type_id
left join ma_machine mm on pmi.ma_code = mm.ma_code
left join ma_type mt on pcd.type_id = mt.type_id
left join ma_type mt1 on mt.parent_id = mt1.type_id
where pcd.task_id = #{taskId}
and pcd.`status`!=3
<if test="dictName != null and dictName != ''">
and (mt.type_name like concat('%',#{dictName},'%') or
mt1.type_name like concat('%',#{dictName},'%'))
</if>
order by status
</select>
<select id="selectTypeByTypeId" resultType="com.bonus.sgzb.base.api.domain.MaType">
select type_id typeId, type_name, parent_id, status, num, unit_id, manage_type, lease_price, buy_price, pay_price,
level, rated_load, test_load, holding_time, warn_num, del_flag, create_by,
create_time, remark, company_id
from ma_type where type_id = #{typeId}
</select>
<select id="selectMacodeInfoStatusByTaskId" resultType="java.lang.Integer">
select count(*) from purchase_check_details where task_id = #{taskId} and status ='1'
</select>
<select id="selectExamineType" resultType="java.lang.Integer">
SELECT
COUNT(*)
FROM
bm_flow_relation bfr
LEFT JOIN bm_flow bf on bfr.flow_id=bf.id
WHERE
bf.task_type='23'
AND bfr.company_id = #{companyId}
and bfr.`status`='1'
and bf.`status`='1'
</select>
<select id="isOperateAll" resultType="java.lang.Integer">
SELECT
count(*)
FROM
purchase_check_details
WHERE
task_id = #{taskId} and status != 6 and status!=7
</select>
<select id="selectPurchaseCheckDetailsStatus" resultType="java.lang.Integer">
SELECT
count(*)
FROM
purchase_check_details
WHERE
task_id = #{taskId} and status != 7 and `status` !=3
</select>
</mapper>

View File

@ -379,7 +379,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join ma_type mt on pcd.type_id = mt.type_id
left join ma_type mt1 on mt.parent_id = mt1.type_id
where pcd.task_id = #{taskId}
and pcd.`status`!=3
and pcd.`status`!=3 and pcd.`status`!=7
<if test="dictName != null and dictName != ''">
and (mt.type_name like concat('%',#{dictName},'%') or
mt1.type_name like concat('%',#{dictName},'%'))

View File

@ -0,0 +1,75 @@
import request from '@/utils/request'
//编辑新购任务
export function updatePurchaseCheckInfo(data) {
return request({
url: '/material/purchaseCheckServiceCenter',
method: 'put',
data: data
})
}
//消息通知
export function bmNoticeInfo(data) {
return request({
url: '/material/purchaseCheckServiceCenter/bmNoticeInfo',
method: 'post',
data: data
})
}
// 新购验收--验收弹窗-确认验收
export function updatePurchaseCheckDetails(data) {
return request({
url: '/material/purchaseCheckDetails',
method: 'put',
data: data
})
}
//新购验收-入库列表
export function getPutInList(query) {
return request({
url: '/material/purchaseCheckServiceCenter/putInList',
method: 'get',
params: query
})
}
export function getPutinDetailsList(query) {
return request({
url: '/material/purchaseCheckServiceCenter/putinDetails',
method: 'get',
params: query
})
}
// 修改状态-审核
export function changePutinStatus(data) {
return request({
url: '/material/purchaseCheckServiceCenter/manageStatus',
method: 'put',
data: data
})
}
//新购工机具入库单
export function warehousingEntry(query) {
return request({
url: '/material/purchaseMacode/warehousingEntry',
method: 'get',
params: query
})
}
//配件入库 配件类型下拉数据
export function getPartList(query) {
return request({
url: '/material/purchaseAccessory/getPartList',
method: 'get',
params: query
})
}

View File

@ -0,0 +1,52 @@
import request from '@/utils/request'
//综合查询
// 查询领料记录列表
export function backRecord(query) {
return request({
url: '/material/backRecord/getBackRecordList',
method: 'get',
params: query
})
}
// 列表导出
export function exportList(params = {}){
return request({
url: '/material/backRecord/export',
method: 'post',
data: params
})
}
// 获取 来往单位 列表
export function getUnitData(params = {}){
return request({
url: '/system/select/getUnitCbx',
method: 'post',
data: params
})
}
// 获取 工程 列表
export function getProData(params = {}){
return request({
url: '/system/select/getSectionEngineeringCbx',
method: 'post',
data: params
})
}

View File

@ -0,0 +1,52 @@
import request from '@/utils/request'
//综合查询
// 查询入库记录列表
export function inputRecord(query) {
return request({
url: '/material/inputRecord/getInputRecordList',
method: 'get',
params: query
})
}
// 列表导出
export function exportList(params = {}){
return request({
url: '/material/inputRecord/export',
method: 'post',
data: params
})
}
// 获取 来往单位 列表
export function getUnitData(params = {}){
return request({
url: '/system/select/getUnitCbx',
method: 'post',
data: params
})
}
// 获取 工程 列表
export function getProData(params = {}){
return request({
url: '/system/select/getSectionEngineeringCbx',
method: 'post',
data: params
})
}

View File

@ -32,7 +32,7 @@
<el-input
v-model="queryParams.keyWord"
placeholder="请输入关键字"
clearable maxlength="50"
clearable maxlength="50"
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
@ -138,7 +138,7 @@
size="mini"
type="success"
icon="el-icon-edit"
v-if="scope.row.purchasingStatus!='已入库'&&scope.row.purchasingStatus!='已验收合格'"
v-if="scope.row.purchasingStatus!='已入库'&&scope.row.purchasingStatus!='已验收合格'&&scope.row.purchasingStatus!='待审核'"
@click="handleAccept(scope.row)"
>验收</el-button>
<el-button
@ -152,7 +152,7 @@
size="mini"
type="info"
icon="el-icon-edit"
v-if="scope.row.purchasingStatus=='已验收合格'||scope.row.purchasingStatus=='已入库'"
v-if="scope.row.purchasingStatus=='已验收合格'||scope.row.purchasingStatus=='已入库' ||scope.row.purchasingStatus=='待审核' "
@click="handlePrint(scope.row)"
>验收单</el-button>
@ -160,7 +160,7 @@
size="mini"
type="danger"
icon="el-icon-delete"
v-if="scope.row.purchasingStatus!='已入库'"
v-if="scope.row.purchasingStatus!='已入库'&&scope.row.purchasingStatus!='已验收合格'&&scope.row.purchasingStatus!='待审核'"
@click="handleDelete(scope.row)"
>删除</el-button>
</template>
@ -425,7 +425,7 @@ export default {
...this.queryParams
}, `新购工机具验收_${new Date().getTime()}.xlsx`)
},
}
};
</script>

View File

@ -0,0 +1,677 @@
<template>
<div class="app-container" id="newDevicesWarehousing">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="日期">
<el-date-picker
v-model="queryParams.time"
type="daterange"
value-format="yyyy-MM-dd"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker>
</el-form-item>
<el-form-item label="设备类型" prop="typeId">
<el-select
v-model="queryParams.typeId"
placeholder="请选择设备类型"
clearable filterable
style="width: 240px"
>
<el-option
v-for="typeItem in typeList"
:key="typeItem.typeId"
:label="typeItem.typeName"
:value="typeItem.typeId"
/>
</el-select>
</el-form-item>
<el-form-item label="关键字" prop="keyWord">
<el-input
v-model="queryParams.keyWord"
placeholder="请输入关键字"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">查询</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['system:dict:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="tableList" >
<!-- <el-table-column type="selection" width="55" align="center" /> -->
<el-table-column label="序号" align="center" type="index" width="55px"/>
<el-table-column label="采购单号" align="center" prop="code" :show-overflow-tooltip="true" />
<el-table-column label="采购日期" align="center" prop="purchaseTime" :show-overflow-tooltip="true" />
<el-table-column label="到货日期" align="center" prop="arrivalTime" :show-overflow-tooltip="true" />
<el-table-column label="采购机具设备" align="center" prop="purchasingTypeName" :show-overflow-tooltip="true" width="250"/>
<el-table-column label="采购员" align="center" prop="purchaserName" :show-overflow-tooltip="true" width="100"/>
<el-table-column label="提交时间" align="center" prop="createTime" :show-overflow-tooltip="true"/>
<el-table-column label="采购状态" align="center" prop="taskStatus">
<template slot-scope="scope">
<span v-if="scope.row.taskStatus=='26'">已验收合格</span>
<span v-if="scope.row.taskStatus=='105'">入库待审核</span>
<span v-if="scope.row.taskStatus=='106'">已驳回</span>
<span v-if="scope.row.taskStatus=='28'">已入库</span>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="200">
<template slot-scope="scope">
<el-button
size="mini"
icon="el-icon-zoom-in"
@click="handleView(scope.row)"
>查看</el-button>
<el-button
size="mini"
type="primary"
icon="el-icon-edit"
v-if="scope.row.taskStatus=='26'"
@click="handleUpdate(scope.row)"
>审核</el-button>
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="info"-->
<!-- icon="el-icon-edit"-->
<!-- v-if="scope.row.taskStatus=='28'"-->
<!-- @click="handlePrint(scope.row)"-->
<!-- >入库单</el-button>-->
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-delete"-->
<!-- @click="handleDelete(scope.row)"-->
<!-- v-hasPermi="['system:dict:remove']"-->
<!-- >删除</el-button>-->
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!--审批对话框 -->
<el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body>
<el-form :model="query" ref="query" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="关键字" prop="dictName">
<el-input
v-model="query.dictName"
placeholder="请输入关键字"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleDialogQuery">查询</el-button>
<!-- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> -->
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8" v-if="showHandle">
<el-col :span="1.5">
<el-button
type="primary"
plain
size="mini"
:disabled="multiple"
@click="passAll"
>批量通过</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
size="mini"
@click="refusedAll"
:disabled="multiple"
>批量不通过</el-button>
</el-col>
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="warning"-->
<!-- plain-->
<!-- icon="el-icon-download"-->
<!-- size="mini"-->
<!-- @click="handleExport"-->
<!-- v-hasPermi="['system:dict:export']"-->
<!-- >导出</el-button>-->
<!-- </el-col>-->
</el-row>
<el-table v-loading="loading" :data="detailTableList" @selection-change="handleSelectionChange" height="400">
<el-table-column type="selection" width="55" align="center" :selectable="selectable"/>
<el-table-column label="序号" align="center" type="index" />
<el-table-column label="机具类型" align="center" prop="typeName" :show-overflow-tooltip="true" />
<el-table-column label="规格型号" align="center" prop="specificationType" :show-overflow-tooltip="true" />
<el-table-column label="数量" align="center" prop="checkNum" :show-overflow-tooltip="true" />
<el-table-column label="编号" align="center" prop="maCode" :show-overflow-tooltip="true" width="200"/>
<el-table-column label="不通过原因" align="center" prop="remark" :show-overflow-tooltip="true" />
<el-table-column label="状态" align="center" prop="status">
<template slot-scope="scope">
<span v-if="scope.row.status=='0'">待审核</span>
<span v-if="scope.row.status=='1'">已入库</span>
<span v-if="scope.row.status=='2'">入库驳回</span>
<span v-if="scope.row.status=='3'">入库待审核</span>
<span v-if="scope.row.status=='4'">已驳回</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" v-if="showHandle" width="150">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
v-if="scope.row.status=='0'"
@click="pass(scope.row)"
>通过</el-button>
<el-button
size="mini"
type="text"
v-if="scope.row.status=='0'"
@click="refused(scope.row)"
>不通过</el-button>
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-delete"-->
<!-- @click="handleDelete(scope.row)"-->
<!-- v-hasPermi="['system:dict:remove']"-->
<!-- >删除</el-button>-->
</template>
</el-table-column>
</el-table>
<pagination
v-show="dialogTotal>0"
:total="dialogTotal"
:page.sync="query.pageNum"
:limit.sync="query.pageSize"
@pagination="getDialogTable"
/>
</el-dialog>
<!-- 入库单弹窗 -->
<el-dialog :visible.sync="openPrint" width="900px" append-to-body>
<div style="height: 600px;overflow-y: scroll;">
<vue-easy-print tableShow ref="remarksPrintRef" class="print">
<div class="title" style="text-align: center;font-weight: 600;font-size: 16px;">
入库单
</div>
<div class="info" style="margin-top: 10px;display: flex;flex-wrap: wrap;">
<div class="item" style="width: 50%;flex-shrink: 0;margin-bottom: 5px;font-size: 14px;">
<span>工程名称</span>
</div>
<div class="item" style="width: 50%;flex-shrink: 0;margin-bottom: 5px;font-size: 14px;">
<span>日期</span>
</div>
<div class="item" style="width: 50%;flex-shrink: 0;margin-bottom: 5px;font-size: 14px;">
<span>领料单号</span>
</div>
<div class="item" style="width: 50%;flex-shrink: 0;margin-bottom: 5px;font-size: 14px;">
<span>车辆信息</span>
</div>
</div>
<el-table :data="printTableData" class="table" style="margin-top: 20px;;padding-bottom: 1px;padding-right:1px;" border>
<!-- <el-table-column type="selection" width="55" align="center" />-->
<el-table-column label="序号" align="center" type="index" />
<el-table-column label="类型名称" align="center" prop="typeName" />
<el-table-column label="规格型号" align="center" prop="specificationType" />
<el-table-column label="计量单位" align="center" prop="" />
<el-table-column label="数量" align="center" prop="checkNum" />
<el-table-column label="备注" align="center" prop="remark" />
<!-- <el-table-column label="出库方式" align="center" prop="manageTypeName" /> -->
</el-table>
<div class="fillIn" style="margin-top: 20px;display: flex;justify-content: space-between;">
<div class="item" style="width: 25%;">
<span>审核</span>
</div>
<div class="item" style="width: 25%;">
<span>库管员</span>
</div>
<div class="item" style="width: 25%;">
<span>经办人</span>
</div>
<div class="item" style="width: 25%;">
<!-- <span>经办人</span> -->
</div>
</div>
</vue-easy-print>
</div>
<div slot="footer" class="dialog-footer" style="text-align: center">
<el-button type="primary" @click="print"> </el-button>
<el-button @click="openPrint = false"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listType, getType, delType, addType, updateType, refreshCache } from "@/api/system/dict/type";
import {getRepairedDetailList, getTypeList, inputByType} from "@/api/store/warehousing";
import { getPutInList,getPutinDetailsList ,changePutinStatus,warehousingEntry} from "@/api/store/newDevicesServiceCenterList";
import vueEasyPrint from 'vue-easy-print';
export default {
// name: "NewDevicesWarehousing",
dicts: ['sys_normal_disable'],
components:{vueEasyPrint},
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
dialogTotal: 0,
//
typeList: [],
modelList: [],
//
tableList: [],
detailTableList: [],
//
title: "",
//
open: false,
openPrint: false,
printData:{},
printTableData:[],
showHandle: true,
//
dateRange: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
dictName: undefined,
dictType: undefined,
status: undefined
},
query: {
pageNum: 1,
pageSize: 10,
},
//
form: {},
//
rules: {
dictName: [
{ required: true, message: "字典名称不能为空", trigger: "blur" }
],
dictType: [
{ required: true, message: "字典类型不能为空", trigger: "blur" }
]
}
};
},
created() {
this.getList();
this.getTypeList();
},
methods: {
getTypeList() {
getTypeList({level:'3'}).then(response => {
this.typeList = response.data;
}
);
getTypeList({level:'4'}).then(response => {
this.modelList = response.data;
}
);
},
/** 查询字典类型列表 */
getList() {
this.loading = true;
const params = {
keyWord:this.queryParams.keyWord,
startTime:this.queryParams.time && this.queryParams.time[0],
endTime:this.queryParams.time && this.queryParams.time[1],
typeId:this.queryParams.typeId,
pageSize: this.queryParams.pageSize,
pageNum: this.queryParams.pageNum
}
getPutInList(this.addDateRange(params)).then(response => {
this.tableList = response.rows;
this.total = response.total;
this.loading = false;
}
);
},
getDialogTable(){
this.loading = true;
getPutinDetailsList(this.query).then(response => {
this.detailTableList = response.rows;
this.dialogTotal = response.total;
this.loading = false;
}
);
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
dictId: undefined,
dictName: undefined,
dictType: undefined,
status: "0",
remark: undefined
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 搜索按钮操作 */
handleDialogQuery() {
this.query.pageNum = 1;
this.getDialogTable();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
selectable(row){
console.log(row)
if(row.status=='0'){
return true
}else{
return false
}
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item)
this.single = selection.length!=1
this.multiple = !selection.length
},
/** 修改按钮操作 */
handleUpdate(row) {
// this.reset();
this.query.taskId = row.taskId
this.getDialogTable()
this.open = true;
this.showHandle = true
this.title = "审核";
},
//
pass(row) {
console.log(row)
console.log(this.query.taskId)
row.taskId = this.query.taskId;
let obj = {
taskId:this.query.taskId,
maId:row.maId,
inputNum:row.checkNum,
maCode:row.maCode,
typeId:row.typeId,
}
let param ={
taskId:this.query.taskId,
checkResult:'1',
inputRecordList:[obj]
}
changePutinStatus(param).then(response => {
if(response.code==200){
this.$modal.msgSuccess("审批成功");
this.getDialogTable();
this.getList()
}else{
this.$modal.msgSuccess("审批失败");
}
});
},
passAll() {
console.log(this.query.taskId)
console.log(this.ids)
this.ids.forEach(item => {
item.taskId = this.query.taskId;
item.typeId= item.typeId
item.maId= item.maId
item.inputNum= item.checkNum
item.maCode= item.maCode
});
let param ={
taskId:this.query.taskId,
checkResult:'1',
inputRecordList:this.ids
}
changePutinStatus(param).then(response => {
if(response.code==200){
this.$modal.msgSuccess("审批成功");
this.getDialogTable();
this.getList()
}else{
this.$modal.msgSuccess("审批失败");
}
});
},
//
refused(row) {
console.log(row)
console.log(this.query.taskId)
row.taskId = this.query.taskId;
let obj = {
taskId:this.query.taskId,
maId:row.maId,
maCode:row.maCode,
inputNum:row.checkNum,
typeId:row.typeId,
}
let param ={
taskId:this.query.taskId,
checkResult:'2',
inputRecordList:[obj]
}
changePutinStatus(param).then(response => {
if(response.code==200){
this.$modal.msgSuccess("审批成功");
this.getDialogTable();
this.getList()
}else{
this.$modal.msgSuccess("审批失败");
}
});
},
refusedAll() {
console.log(this.query.taskId)
console.log(this.ids)
this.ids.forEach(item => {
item.taskId = this.query.taskId;
item.typeId= item.typeId
item.maId= item.maId
item.inputNum= item.checkNum
item.maCode= item.maCode
});
let param ={
taskId:this.query.taskId,
checkResult:'2',
inputRecordList:this.ids
}
changePutinStatus(param).then(response => {
if(response.code==200){
this.$modal.msgSuccess("审批成功");
this.getDialogTable();
this.getList()
}else{
this.$modal.msgSuccess("审批失败");
}
});
},
/** 提交按钮 */
submitForm: function() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.dictId != undefined) {
updateType(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addType(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
//
handleView(row) {
this.query.taskId = row.taskId
this.getDialogTable()
this.open = true;
this.showHandle = false
this.title = "查看";
},
//
getPrintTable(taskId){
warehousingEntry({taskId:taskId}).then(response => {
this.printTableData = response.data;
// this.dialogTotal = response.total;
}
);
},
//
handlePrint(row) {
this.query.taskId = row.taskId
this.getPrintTable(row.taskId)
this.openPrint = true
this.title = "入库单";
},
//
print(){
this.$refs.remarksPrintRef.print();
},
/** 删除按钮操作 */
handleDelete(row) {
const dictIds = row.dictId || this.ids;
this.$modal.confirm('是否确认删除字典编号为"' + dictIds + '"的数据项?').then(function() {
return delType(dictIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('material/purchaseCheckInfo/putInExport', {
...this.queryParams
}, `新购工机具入库_${new Date().getTime()}.xlsx`)
},
/** 刷新缓存按钮操作 */
handleRefreshCache() {
refreshCache().then(() => {
this.$modal.msgSuccess("刷新成功");
this.$store.dispatch('dict/cleanDict');
});
}
}
};
</script>
<style lang="scss" scoped>
.print{
width: 90%;
padding-left: 5%;
padding-right:1%;
.title{
text-align: center;
font-weight: 600;
font-size: 16px;
}
.info{
margin-top: 10px;
display: flex;
flex-wrap: wrap;
.item{
width: 50%;
flex-shrink: 0;
margin-bottom: 5px;
font-size: 14px;
}
}
.fillIn{
margin-top: 15px;
display: flex;
justify-content: space-between;
}
}
::v-deep.el-table .fixed-width .el-button--mini {
width: 60px !important;
margin-bottom: 10px;
}
</style>

View File

@ -5,7 +5,7 @@
<el-input
v-model="queryParams.keyWord"
placeholder="请输入关键字"
clearable maxlength="50"
clearable maxlength="50"
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
@ -47,6 +47,7 @@
<template slot-scope="scope">
<span v-if="scope.row.taskStatus=='26'">已验收合格</span>
<span v-if="scope.row.taskStatus=='28'">已入库</span>
<span v-if="scope.row.taskStatus=='105'">待审核</span>
</template>
</el-table-column>
@ -57,12 +58,12 @@
icon="el-icon-zoom-in"
@click="handleView(scope.row)"
>查看</el-button>
<el-button
size="mini"
type="primary"
icon="el-icon-edit"
v-if="scope.row.taskStatus=='26'"
v-if="scope.row.taskStatus=='26' || scope.row.taskStatus=='105'"
@click="handleUpdate(scope.row)"
>审核</el-button>
<el-button
@ -98,12 +99,12 @@
<el-input
v-model="query.dictName"
placeholder="请输入关键字"
clearable maxlength="50"
clearable maxlength="50"
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleDialogQuery">查询</el-button>
<!-- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> -->
@ -146,7 +147,7 @@
<el-table-column label="规格型号" align="center" prop="specificationType" :show-overflow-tooltip="true" />
<el-table-column label="数量" align="center" prop="checkNum" :show-overflow-tooltip="true" />
<el-table-column label="编号" align="center" prop="maCode" :show-overflow-tooltip="true" width="200"/>
<el-table-column label="不通过原因" align="center" prop="remark" :show-overflow-tooltip="true" />
<el-table-column label="状态" align="center" prop="status">
<template slot-scope="scope">
@ -184,12 +185,12 @@
</el-dialog>
<!-- 入库单弹窗 -->
<el-dialog :visible.sync="openPrint" width="900px" append-to-body>
<div style="height: 600px;overflow-y: scroll;">
<vue-easy-print tableShow ref="remarksPrintRef" class="print">
@ -226,7 +227,7 @@
<div class="item" style="width: 25%;">
<span>审核</span>
</div>
<div class="item" style="width: 25%;">
<span>库管员</span>
</div>
@ -240,9 +241,9 @@
</vue-easy-print>
</div>
<div slot="footer" class="dialog-footer" style="text-align: center">
@ -326,7 +327,7 @@ export default {
this.getList();
},
methods: {
/** 查询字典类型列表 */
getList() {
this.loading = true;
@ -347,7 +348,7 @@ export default {
}
);
},
//
cancel() {
this.open = false;
@ -403,7 +404,7 @@ export default {
this.showHandle = true
this.title = "审核";
},
//
pass(row) {
console.log(row)
@ -500,7 +501,7 @@ export default {
checkResult:'2',
inputRecordList:this.ids
}
changePutinStatus(param).then(response => {
if(response.code==200){
this.$modal.msgSuccess("审批成功");
@ -540,10 +541,10 @@ export default {
this.title = "查看";
},
//
getPrintTable(taskId){
getPrintTable(taskId){
warehousingEntry({taskId:taskId}).then(response => {
this.printTableData = response.data;
// this.dialogTotal = response.total;
// this.dialogTotal = response.total;
}
);
},
@ -552,13 +553,13 @@ export default {
this.query.taskId = row.taskId
this.getPrintTable(row.taskId)
this.openPrint = true
this.title = "入库单";
this.title = "入库单";
},
//
print(){
this.$refs.remarksPrintRef.print();
},
/** 删除按钮操作 */
handleDelete(row) {
const dictIds = row.dictId || this.ids;
@ -619,4 +620,5 @@ export default {
width: 60px !important;
margin-bottom: 10px;
}
</style>
</style>

View File

@ -0,0 +1,254 @@
<template>
<div class="app-container" id="backRecord">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
<el-form-item label="退料日期">
<el-date-picker
v-model="queryParams.time"
type="daterange"
value-format="yyyy-MM-dd"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker>
</el-form-item>
<el-form-item label="往来单位">
<el-select v-model="queryParams.unitId" clearable @change="GetProData" style="width: 240px" placeholder="请选择">
<el-option
v-for="item in unitList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="工程名称">
<el-select v-model="queryParams.proId" clearable @change="GetUnitData" style="width: 240px" placeholder="请选择">
<el-option
v-for="item in proList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="协议号" prop="agreementCode">
<el-input
v-model="queryParams.agreementCode"
placeholder="请输入协议号"
clearable
:maxlength="20"
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="机具名称" prop="typeName">
<el-input
v-model="queryParams.typeName"
placeholder="请输入机具名称"
clearable
:maxlength="20"
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="规格型号" prop="typeModelName">
<el-input
v-model="queryParams.typeModelName"
placeholder="请输入规格型号"
clearable
:maxlength="20"
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="关键字" prop="keyWord">
<el-input
v-model="queryParams.keyWord"
placeholder="请输入关键字"
clearable
:maxlength="20"
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">查询</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
<el-table v-loading="loading" :data="leaseAuditList">
<!-- <el-table-column type="selection" width="55" align="center" /> -->
<el-table-column label="序号" align="center" type="index" />
<el-table-column label="机具名称" align="center" prop="typeName" :show-overflow-tooltip="true" />
<el-table-column label="机具规格" align="center" prop="typeModelName" :show-overflow-tooltip="true" />
<el-table-column label="退料单号" align="center" prop="code" :show-overflow-tooltip="true" />
<el-table-column label="设备编码" align="center" prop="maCode" :show-overflow-tooltip="true" />
<el-table-column label="退料数量" align="center" prop="backNum" :show-overflow-tooltip="true" />
<el-table-column label="退料人" align="center" prop="backPerson" :show-overflow-tooltip="true" />
<el-table-column label="退料日期" align="center" prop="createTime" :show-overflow-tooltip="true" />
<el-table-column label="退料单位" align="center" prop="unitName" :show-overflow-tooltip="true" />
<el-table-column label="退料工程" align="center" prop="proName" :show-overflow-tooltip="true" />
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
:page-sizes="[5,10,15,20,30]"
@pagination="getList"
/>
</div>
</template>
<script>
import { backRecord,exportList,getUnitData,getProData } from "@/api/stquery/backRecord";
export default {
name: "backRecord",
dicts: ['sys_normal_disable'],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
leaseAuditList: [],
//
dateRange: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
dictName: undefined,
dictType: undefined,
status: undefined,
time:null, //
unitId:null, //id
proId:null, //id
types: 1, // 1 2
},
unitList:[], //
proList:[], //
};
},
created() {
this.getList();
this.getUnitList();
this.getProList();
},
methods: {
//
async getList() {
this.loading = true;
const params = {
unitId:this.queryParams.unitId,
proId:this.queryParams.proId,
keyWord:this.queryParams.keyWord,
agreementCode:this.queryParams.agreementCode,
typeName:this.queryParams.typeName,
typeModelName:this.queryParams.typeModelName,
startTime:this.queryParams.time && this.queryParams.time[0],
endTime:this.queryParams.time && this.queryParams.time[1],
pageSize: this.queryParams.pageSize,
pageNum: this.queryParams.pageNum
}
const res = await backRecord(params)
this.loading = false;
this.leaseAuditList = res.data.rows;
this.total = res.data.total;
},
//
async getUnitList(){
const params = {
id:this.queryParams.proId
}
const res = await getUnitData(params)
this.unitList = res.data
console.log('GetUnitData ======================',res)
},
//
async getProList(){
const params = {
id:this.queryParams.unitId
}
const res = await getProData(params)
this.proList = res.data
console.log('GetProData ======================',res)
},
//
reset() {
this.form = {
dictId: undefined,
dictName: undefined,
dictType: undefined,
status: "0",
remark: undefined
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.dateRange = [];
this.resetForm("queryForm");
this.handleQuery();
},
/** 导出按钮操作 */
handleExport() {
this.download('material/backRecord/export', {
...this.queryParams
}, `综合查询_退料记录_${new Date().getTime()}.xlsx`)
}
}
};
</script>
<style lang="scss" scoped>
::v-deep.el-table .fixed-width .el-button--mini {
width: 60px !important;
margin-bottom: 10px;
}
</style>

View File

@ -0,0 +1,224 @@
<template>
<div class="app-container" id="inputRecord">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
<el-form-item label="入库日期">
<el-date-picker
v-model="queryParams.time"
type="daterange"
value-format="yyyy-MM-dd"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker>
</el-form-item>
<el-form-item label="机具名称" prop="typeName">
<el-input
v-model="queryParams.typeName"
placeholder="请输入机具名称"
clearable
:maxlength="20"
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="规格型号" prop="typeModelName">
<el-input
v-model="queryParams.typeModelName"
placeholder="请输入规格型号"
clearable
:maxlength="20"
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="关键字" prop="keyWord">
<el-input
v-model="queryParams.keyWord"
placeholder="请输入关键字"
clearable
:maxlength="20"
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">查询</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
<el-table v-loading="loading" :data="leaseAuditList">
<!-- <el-table-column type="selection" width="55" align="center" /> -->
<el-table-column label="序号" align="center" type="index" />
<el-table-column label="机具类型" align="center" prop="typeName" :show-overflow-tooltip="true" />
<el-table-column label="规格型号" align="center" prop="typeModelName" :show-overflow-tooltip="true" />
<el-table-column label="二维码编号" align="center" prop="qrCode" :show-overflow-tooltip="true" />
<el-table-column label="设备编码" align="center" prop="maCode" :show-overflow-tooltip="true" />
<el-table-column label="单位" align="center" prop="unit" :show-overflow-tooltip="true" />
<el-table-column label="入库数量" align="center" prop="inputNum" :show-overflow-tooltip="true" />
<el-table-column label="入库时间" align="center" prop="createTime" :show-overflow-tooltip="true" />
<el-table-column label="入库人" align="center" prop="userName" :show-overflow-tooltip="true" />
<el-table-column label="入库类型" align="center" prop="inputType" :show-overflow-tooltip="true" />
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
:page-sizes="[5,10,15,20,30]"
@pagination="getList"
/>
</div>
</template>
<script>
import { inputRecord,exportList,getUnitData,getProData } from "@/api/stquery/deviceInStoreQuery";
export default {
name: "inputRecord",
dicts: ['sys_normal_disable'],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
leaseAuditList: [],
//
dateRange: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
dictName: undefined,
dictType: undefined,
status: undefined,
time:null, //
unitId:null, //id
proId:null, //id
types: 1, // 1 2
},
unitList:[], //
proList:[], //
};
},
created() {
this.getList();
this.getUnitList();
this.getProList();
},
methods: {
//
async getList() {
this.loading = true;
const params = {
unitId:this.queryParams.unitId,
proId:this.queryParams.proId,
keyWord:this.queryParams.keyWord,
agreementCode:this.queryParams.agreementCode,
typeName:this.queryParams.typeName,
typeModelName:this.queryParams.typeModelName,
startTime:this.queryParams.time && this.queryParams.time[0],
endTime:this.queryParams.time && this.queryParams.time[1],
pageSize: this.queryParams.pageSize,
pageNum: this.queryParams.pageNum
}
const res = await inputRecord(params)
this.loading = false;
this.leaseAuditList = res.data.rows;
this.total = res.data.total;
},
//
async getUnitList(){
const params = {
id:this.queryParams.proId
}
const res = await getUnitData(params)
this.unitList = res.data
console.log('GetUnitData ======================',res)
},
//
async getProList(){
const params = {
id:this.queryParams.unitId
}
const res = await getProData(params)
this.proList = res.data
console.log('GetProData ======================',res)
},
//
reset() {
this.form = {
dictId: undefined,
dictName: undefined,
dictType: undefined,
status: "0",
remark: undefined
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.dateRange = [];
this.resetForm("queryForm");
this.handleQuery();
},
/** 导出按钮操作 */
handleExport() {
this.download('material/inputRecord/export', {
...this.queryParams
}, `综合查询_入库记录_${new Date().getTime()}.xlsx`)
}
}
};
</script>
<style lang="scss" scoped>
::v-deep.el-table .fixed-width .el-button--mini {
width: 60px !important;
margin-bottom: 10px;
}
</style>