测试问题修改
This commit is contained in:
parent
2a83e629a8
commit
0d9eba2cee
@ -152,4 +152,11 @@ public class PurchaseOrderMakeController {
|
||||
public CommonResult<PurchaseOrderMakeDO> obtainReviewDetails(@RequestParam("id") Long id) {
|
||||
return partPurchaseOrderService.obtainReviewDetails(id);
|
||||
}
|
||||
@GetMapping("/countReview")
|
||||
@Operation(summary = "待审批消息")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('heli:bdgzsomthing:query')")
|
||||
public CommonResult<Long> countReview() {
|
||||
return success(partPurchaseOrderService.countReview());
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.chanko.yunxi.mes.module.heli.controller.admin.purchaseorderno;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.purchaseorder.vo.PurchaseOrderPageReqVO;
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.purchaseorder.vo.PurchaseOrderRespVO;
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.purchaseorder.vo.PurchaseOrderSaveReqVO;
|
||||
@ -27,8 +28,10 @@ import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.awt.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||
@ -132,10 +135,7 @@ public class PurchaseOrderNoController {
|
||||
@Operation(summary = "更新采购订单收获状态")
|
||||
@PreAuthorize("@ss.hasPermission('heli:purchase-order:updateRSById')")
|
||||
public CommonResult<Boolean> updatePORSById(@RequestParam("id") Long id) {
|
||||
PurchaseOrderNoDO purchaseOrderNo = purchaseOrderNoService.getPurchaseOrderNo(id);
|
||||
purchaseOrderNo.setReceivingStatus(3);
|
||||
PurchaseOrderNoSaveReqVO purchaseOrderVO = BeanUtils.toBean(purchaseOrderNo, PurchaseOrderNoSaveReqVO.class);
|
||||
purchaseOrderNoService.updatePurchaseOrderNo(purchaseOrderVO);
|
||||
purchaseOrderNoService.updatePORSById(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
|
@ -308,5 +308,9 @@ public class StorageController {
|
||||
List<StorageDO> list = storageService.getList(id, projectSubId);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
@PostMapping("/procurementAndStorage")
|
||||
@Operation(summary = "procurementAndStorage")
|
||||
public CommonResult<Boolean> procurementAndStorage(@Valid @RequestBody StorageSaveReqVO createReqVO) {
|
||||
return storageService.procurementAndStorage(createReqVO);
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,8 @@ package com.chanko.yunxi.mes.module.heli.controller.admin.storage.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
import java.util.*;
|
||||
@ -70,4 +72,14 @@ public class StorageSaveReqVO {
|
||||
private String projectNo;
|
||||
@Schema(description = "提交前的状态", example = "提交前的状态")
|
||||
private Integer beforeStatus;
|
||||
@Schema(description = "入库数量", example = "你说的对")
|
||||
private BigDecimal storageAmount;
|
||||
@Schema(description = "采购明细id")
|
||||
private Long purchaseOrderId;
|
||||
@Schema(description = "物料id")
|
||||
private Long materialId;
|
||||
@Schema(description = "库区id")
|
||||
private Long rgId;
|
||||
@Schema(description = "库位id")
|
||||
private Long pnId;
|
||||
}
|
||||
|
@ -68,7 +68,14 @@ public class StorageMatDO extends BaseDO {
|
||||
* 备注
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 采购单id
|
||||
*/
|
||||
private Long purchaseOrderNoId;
|
||||
/**
|
||||
* 采购单明细id
|
||||
*/
|
||||
private Long purchaseOrderNoDetailId;
|
||||
@TableField(exist = false)
|
||||
private String matName;
|
||||
|
||||
|
@ -101,7 +101,7 @@ public interface MaterialPlanBoomMapper extends BaseMapperX<MaterialPlanBoomDO>
|
||||
query.in(MaterialPlanBoomDO::getMplanStatus,Arrays
|
||||
.asList(0,3,5));
|
||||
}else{
|
||||
query.eq(MaterialPlanBoomDO::getMplanStatus,1);
|
||||
query.eq(MaterialPlanBoomDO::getMplanStatus,pageReqVO.getMplanStatus() );
|
||||
}
|
||||
// query.like(ObjectUtil.isNotEmpty(pageReqVO.getMplanStatus()),ProjectOrderDO::getCode, pageReqVO.getProjectCode());
|
||||
|
||||
|
@ -2,6 +2,7 @@ package com.chanko.yunxi.mes.module.heli.dal.mysql.purchaseorderno;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||
import com.chanko.yunxi.mes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.chanko.yunxi.mes.framework.mybatis.core.mapper.BaseMapperX;
|
||||
@ -15,7 +16,6 @@ import com.chanko.yunxi.mes.module.heli.dal.dataobject.supplier.SupplierDO;
|
||||
import com.chanko.yunxi.mes.module.heli.enums.PurchaseStatusEnum;
|
||||
import com.chanko.yunxi.mes.module.system.dal.dataobject.user.AdminUserDO;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import io.netty.util.internal.ObjectUtil;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.purchaseorderno.vo.*;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
@ -89,7 +89,7 @@ public interface PurchaseOrderNoMapper extends BaseMapperX<PurchaseOrderNoDO> {
|
||||
query.like(!StringUtils.isEmpty(pageReqVO.getPurchaseNo()), PurchaseOrderNoDO::getPurchaseNo, pageReqVO.getPurchaseNo())
|
||||
.like(!StringUtils.isEmpty(pageReqVO.getSupplierName()), "s.name", pageReqVO.getSupplierName())
|
||||
.like(!StringUtils.isEmpty(pageReqVO.getMaterialPlanNo()), "m.project_material_plan_no", pageReqVO.getMaterialPlanNo())
|
||||
.apply(pageReqVO.getCreateTime() != null, "DATE_FORMAT(t.create_time,'%Y-%m-%d') = {0}", pageReqVO.getCreateTime())
|
||||
.apply(ObjectUtil.isNotEmpty(pageReqVO.getCreateTime()), "DATE_FORMAT(t.create_time,'%Y-%m-%d') = {0}", pageReqVO.getCreateTime())
|
||||
.eq(pageReqVO.getStatus() != null, PurchaseOrderNoDO::getStatus, pageReqVO.getStatus())
|
||||
.eq(pageReqVO.getAuditor() != null, PurchaseOrderNoDO::getAuditor, pageReqVO.getAuditor())
|
||||
.ne(true, PurchaseOrderDO::getStatus, PurchaseStatusEnum.START.getCode())
|
||||
|
@ -65,4 +65,6 @@ public interface PartPurchaseOrderService {
|
||||
Boolean createPurchaseOrderMakeAndDetailBatch(List<MaterialPlanBoomDO> updateReqVOs);
|
||||
|
||||
CommonResult<PurchaseOrderMakeDO> obtainReviewDetails(Long id);
|
||||
|
||||
Long countReview();
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package com.chanko.yunxi.mes.module.heli.service.partpurchaseorder;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.chanko.yunxi.mes.framework.common.exception.ErrorCode;
|
||||
@ -346,6 +347,15 @@ public class PartPurchaseOrderServiceImpl implements PartPurchaseOrderService{
|
||||
return CommonResult.success(orderMakeDO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long countReview() {
|
||||
LambdaQueryWrapper<PurchaseOrderMakeDO> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(PurchaseOrderMakeDO::getSubmitUserId,getLoginUser().getId());
|
||||
queryWrapper.eq(PurchaseOrderMakeDO::getStatus,1);
|
||||
queryWrapper.eq(PurchaseOrderMakeDO::getDeleted,0);
|
||||
return purchaseOrderMakeMapper.selectCount(queryWrapper);
|
||||
}
|
||||
|
||||
public Boolean createPurchaseOrderMakeAndDetail(MaterialPlanBoomDO updateReqVO, long purchaseOrderMakeId, String purchaseOrderMakeDOPurchaseNo,Long planId) {
|
||||
PurchaseOrderMakeDetailDO purchaseOrderMakeDetailDO = new PurchaseOrderMakeDetailDO();
|
||||
purchaseOrderMakeDetailDO.setPurchaseOrderId(purchaseOrderMakeId);
|
||||
|
@ -61,4 +61,6 @@ public interface PurchaseOrderNoService {
|
||||
CommonResult<PurchaseOrderNoDO> isPrint(Long id);
|
||||
|
||||
CommonResult<Boolean> deleteForm(Long id);
|
||||
|
||||
void updatePORSById(Long id);
|
||||
}
|
||||
|
@ -103,7 +103,7 @@ public class PurchaseOrderNoServiceImpl implements PurchaseOrderNoService {
|
||||
SerialNumberDO serialNumberDO = new SerialNumberDO();
|
||||
serialNumberDO = serialNumberService.getSerialNumber(PURCHASE_ORDER.name(), new SimpleDateFormat("yyyyMMdd").format(new Date()));
|
||||
serialNumberDO.setSerialNumber(serialNumberDO.getSerialNumber()+1);
|
||||
|
||||
purchaseOrderNo.setOrdDate(new Date());
|
||||
purchaseOrderNo.setPurchaseNo(PURCHASE_ORDER.getCode(serialNumberDO.getSerialNumber().toString()));
|
||||
purchaseOrderNoMapper.insert(purchaseOrderNo);
|
||||
// 回写序列记录
|
||||
@ -389,4 +389,12 @@ public class PurchaseOrderNoServiceImpl implements PurchaseOrderNoService {
|
||||
return CommonResult.success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updatePORSById(Long id) {
|
||||
LambdaUpdateWrapper<PurchaseOrderNoDO> wrapper = new LambdaUpdateWrapper<>();
|
||||
wrapper.eq(PurchaseOrderNoDO::getId,id);
|
||||
wrapper.set(PurchaseOrderNoDO::getReceivingStatus,3);
|
||||
purchaseOrderNoMapper.update(wrapper);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.CommonResult;
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.outsourcestockboom.vo.OutsourceStockBoomSaveReqVO;
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.storage.vo.*;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.storage.StorageDO;
|
||||
@ -72,4 +73,6 @@ public interface StorageService {
|
||||
PageResult<StorageDO> getStoragePage(StoragePageReqVO pageReqVO);
|
||||
|
||||
List<StorageDO> getList(Long id, Long projectSubId);
|
||||
|
||||
CommonResult<Boolean> procurementAndStorage(StorageSaveReqVO createReqVO);
|
||||
}
|
||||
|
@ -1,6 +1,10 @@
|
||||
package com.chanko.yunxi.mes.module.heli.service.storage;
|
||||
|
||||
import cn.hutool.core.lang.UUID;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.CommonResult;
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.outsourcestockboom.vo.OutsourceStockBoomSaveReqVO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.bdgzsomthing.bdgzsomthingDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.composition.CompositionDO;
|
||||
@ -9,6 +13,7 @@ import com.chanko.yunxi.mes.module.heli.dal.dataobject.outsourcestock.OutsourceS
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.outsourcestockboom.OutsourceStockBoomDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.outsourcestockmaterial.OutsourceStockMaterialDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseorder.PurchaseOrderDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseordernodetail.PurchaseOrderNoDetailDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.serialnumber.SerialNumberDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagelog.StorageLogDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagelogNow.StorageLogNowDO;
|
||||
@ -20,6 +25,7 @@ import com.chanko.yunxi.mes.module.heli.dal.mysql.outsourcestock.OutsourceStockM
|
||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.outsourcestockboom.OutsourceStockBoomMapper;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.outsourcestockmaterial.OutsourceStockMaterialMapper;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.purchaseorder.PurchaseOrderMapper;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.purchaseordernodetail.PurchaseOrderNoDetailMapper;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.storagelog.StorageLogNowMapper;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.storagemat.StorageMatMapper;
|
||||
import com.chanko.yunxi.mes.module.heli.enums.BusinesTypeEnum;
|
||||
@ -45,6 +51,7 @@ import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.storage.StorageMapper;
|
||||
|
||||
import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.chanko.yunxi.mes.framework.security.core.util.SecurityFrameworkUtils.getLoginUser;
|
||||
import static com.chanko.yunxi.mes.module.heli.enums.CodeEnum.*;
|
||||
import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.*;
|
||||
|
||||
@ -85,6 +92,8 @@ public class StorageServiceImpl implements StorageService {
|
||||
|
||||
@Resource
|
||||
private PurchaseOrderMapper purchaseOrderMapper;
|
||||
@Resource
|
||||
private PurchaseOrderNoDetailMapper purchaseOrderNoDetailMapper;
|
||||
|
||||
@Resource
|
||||
private StorageLogService storageLogService;
|
||||
@ -395,4 +404,47 @@ private StorageLogService storageLogService;
|
||||
return storageMapper.getList(id,projectSubId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> procurementAndStorage(StorageSaveReqVO createReqVO) {
|
||||
if (ObjectUtil.isEmpty(createReqVO.getStorageAmount())|| createReqVO.getStorageAmount().compareTo(BigDecimal.ZERO) <= 0) {
|
||||
return CommonResult.error(400,"剩余数量为空或者为0,请确认!");
|
||||
}
|
||||
//自动生成入库单
|
||||
StorageDO storageDO = new StorageDO();
|
||||
storageDO.setStockType(1);
|
||||
storageDO.setWhId(createReqVO.getWhId());
|
||||
// 月度流水号
|
||||
SerialNumberDO serialNumberDO1 = serialNumberService.getSerialNumber(CodeEnum.STOCK_IN.name(), new SimpleDateFormat("yyyyMMdd").format(new Date()));
|
||||
serialNumberDO1.setSerialNumber(serialNumberDO1.getSerialNumber()+1);
|
||||
// 入库前缀
|
||||
storageDO.setStockNo(STOCK_IN.getCode(serialNumberDO1.getSerialNumber().toString()));
|
||||
serialNumberService.updateSerialNumber(serialNumberDO1);
|
||||
storageDO.setStatus(2);
|
||||
storageDO.setKeeper(getLoginUser().getId());
|
||||
storageDO.setKeeperTime(LocalDateTime.now());
|
||||
storageMapper.insert(storageDO);
|
||||
|
||||
|
||||
//入库明细
|
||||
StorageMatDO storageMatDO = new StorageMatDO();
|
||||
storageMatDO.setStockId(storageDO.getId());
|
||||
storageMatDO.setStorageOkQty(createReqVO.getStorageAmount());
|
||||
storageMatDO.setMatId(createReqVO.getMaterialId());
|
||||
storageMatDO.setPurchaseOrderNoId(createReqVO.getPurchaseOrderId());
|
||||
storageMatDO.setPurchaseOrderNoDetailId(createReqVO.getId());
|
||||
storageMatDO.setWhId(createReqVO.getWhId());
|
||||
storageMatDO.setRgId(createReqVO.getRgId());
|
||||
storageMatDO.setPnId(createReqVO.getPnId());
|
||||
storageMatMapper.insert(storageMatDO);
|
||||
//入库日志
|
||||
updateMatLogList(storageDO.getId(),2);
|
||||
|
||||
LambdaUpdateWrapper<PurchaseOrderNoDetailDO> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.eq(PurchaseOrderNoDetailDO::getId,createReqVO.getId());
|
||||
updateWrapper.set(PurchaseOrderNoDetailDO::getReceivingStatus,3);
|
||||
updateWrapper.set(PurchaseOrderNoDetailDO::getPurchaseRemAmount,BigDecimal.ZERO);
|
||||
purchaseOrderNoDetailMapper.update(updateWrapper);
|
||||
return CommonResult.success(true);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -345,9 +345,7 @@ public class StorageInServiceImpl implements StorageInService {
|
||||
if (sum.compareTo(purchaseOrderNoDetailDO.getBoomAmount())!=0){
|
||||
return CommonResult.error(400,"该入库数量"+sum+"!=需求数量"+purchaseOrderNoDetailDO.getBoomAmount()+"请确认!");
|
||||
}
|
||||
purchaseOrderNoDetailDO.setReceivingStatus(3);
|
||||
purchaseOrderNoDetailDO.setPurchaseRemAmount(BigDecimal.ZERO);
|
||||
purchaseOrderNoDetailMapper.updateById(purchaseOrderNoDetailDO);
|
||||
|
||||
return CommonResult.success(true);
|
||||
}
|
||||
|
||||
|
@ -1,26 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.chanko.yunxi</groupId>
|
||||
<artifactId>mes-module-system</artifactId>
|
||||
<version>2.0.0-jdk8-snapshot</version>
|
||||
</parent>
|
||||
<groupId>com.chanko.yunxi</groupId>
|
||||
<artifactId>mes-module-system-api</artifactId>
|
||||
<version>2.0.0-jdk8-snapshot</version>
|
||||
<name>${project.artifactId}</name>
|
||||
<description>system 模块 API,暴露给其它模块调用</description>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.chanko.yunxi</groupId>
|
||||
<artifactId>mes-common</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-validation</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
@ -61,7 +61,7 @@ export const getPurchaseOrderNoPageByStatus = async (params) => {
|
||||
}
|
||||
// 修改采购订单收获状态
|
||||
export const updateReceivingStatus = async (id: number) => {
|
||||
return await request.put({ url: `/heli/purchase-order/updateRSById?id=` + id })
|
||||
return await request.put({ url: `/heli/purchase-order-no/updateRSById?id=` + id })
|
||||
}
|
||||
// 删除
|
||||
export const deleteForm = async (id: number) => {
|
||||
@ -72,3 +72,8 @@ export const deleteForm = async (id: number) => {
|
||||
export const isPrint = async (id: number) => {
|
||||
return await request.get({ url: `/heli/purchase-order-no/isPrint?id=` + id })
|
||||
}
|
||||
|
||||
|
||||
export const countReview = async () => {
|
||||
return await request.get({ url: `/heli/purchase-order-make/countReview` })
|
||||
}
|
||||
|
@ -61,3 +61,7 @@ export const deleteStorage = async (id: number) => {
|
||||
export const exportStorage = async (params) => {
|
||||
return await request.download({ url: `/heli/storage/export-excel`, params })
|
||||
}
|
||||
// 新增入/出库
|
||||
export const procurementAndStorage = async (data) => {
|
||||
return await request.post({ url: `/heli/storage/procurementAndStorage`, data })
|
||||
}
|
||||
|
@ -202,6 +202,7 @@ const queryParams = reactive({
|
||||
materialName:undefined,
|
||||
matName:undefined,
|
||||
projectMaterialPlanNo:undefined,
|
||||
matType:1
|
||||
})
|
||||
const queryFormRef = ref() // 搜索的表单
|
||||
const exportLoading = ref(false) // 导出的加载中
|
||||
|
@ -66,8 +66,8 @@
|
||||
</el-form>
|
||||
<div class="hl-footer text-center">
|
||||
<template v-if="formData.type === 'check'">
|
||||
<el-button @click="approve" size="large">批 准</el-button>
|
||||
<el-button @click="handleReject" size="large">驳 回</el-button>
|
||||
<el-button @click="approve" type="primary" size="large">批 准</el-button>
|
||||
<el-button @click="handleReject" size="large" type="danger">驳 回</el-button>
|
||||
<el-button @click="cancel" size="large">取 消</el-button>
|
||||
</template>
|
||||
<template v-if="formData.type === 'detail'">
|
||||
|
@ -296,6 +296,7 @@ const formData = ref({
|
||||
})
|
||||
const formRules = reactive({
|
||||
projectCode: [{ required: true, message: '项目编号不能为空', trigger: 'blur' }],
|
||||
projectOwner: [{ required: true, message: '项目负责人不能为空', trigger: 'blur' }],
|
||||
|
||||
})
|
||||
const projectOrderDialog = ref()
|
||||
@ -308,10 +309,10 @@ const handleSelectedProjectOrder = (arr: ProjectOrderVO[]) => {
|
||||
formData.value.projectStatus = arr.orderStatus
|
||||
formData.value.customerName = arr.customerName
|
||||
formData.value.projectName = arr.projectName
|
||||
formData.value.businessMan = arr.businessManName
|
||||
formData.value.projectStartTime = arr.projectStartTime
|
||||
formData.value.projectEndTime = arr.projectEndTime
|
||||
formData.value.businessLine = arr.businessLine
|
||||
formData.value.businessMan = arr.businessManName
|
||||
formData.value.projectStartTime = arr.projectStartTime
|
||||
formData.value.projectEndTime = arr.projectEndTime
|
||||
formData.value.businessLine = arr.businessLine
|
||||
formData.value.property = arr.property
|
||||
formData.value.isUrgency = arr.isUrgency
|
||||
formData.value.projectId = arr.id
|
||||
|
@ -298,7 +298,7 @@ class="!w-265px" v-model="formData.createTime" type="date" value-format="x"
|
||||
</template>
|
||||
<el-row>
|
||||
<el-col>
|
||||
<el-card class="hl-incard">
|
||||
<el-card class="hl-incard">
|
||||
<el-form
|
||||
ref="projectOrderSubFormRef" :model="formData.projectOrderSubs" :rules="subFormRules"
|
||||
v-loading="subFormLoading" label-width="0">
|
||||
@ -551,6 +551,8 @@ const formData = ref({
|
||||
})
|
||||
const formRules = reactive({
|
||||
projectCode: [{ required: true, message: '项目编号不能为空', trigger: 'blur' }],
|
||||
projectOwner: [{ required: true, message: '项目负责人不能为空', trigger: 'blur' }],
|
||||
|
||||
|
||||
})
|
||||
const projectOrderDialog = ref()
|
||||
@ -566,7 +568,7 @@ const printfClick = () =>{
|
||||
message.error("至少选择一项后,打印!")
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
for(var i = 0 ; i < clickItem.value.length ; i ++ ){
|
||||
var item = clickItem.value[i];
|
||||
if(item.id == null ){
|
||||
|
@ -313,7 +313,7 @@ class="!w-265px" v-model="formData.changeEndTime" type="date" value-format="x"
|
||||
|
||||
<el-card class="hl-card-info">
|
||||
<template #header>
|
||||
<div class="hl-card-info-icona"></div><span class="hl-card-info-text">子项目信息</span>
|
||||
<div class="hl-card-info-icona"></div><span class="hl-card-info-text">子项目信息</span>
|
||||
<el-button style="margin-left: 3%" type="warning" size="large" @click="printfClick">打印</el-button>
|
||||
|
||||
</template>
|
||||
@ -704,6 +704,7 @@ const dataListShuju = ref([]);
|
||||
const dataListShujus = ref([]);
|
||||
const formRules = reactive({
|
||||
projectCode: [{ required: true, message: '项目编号不能为空', trigger: 'blur' }],
|
||||
projectOwner: [{ required: true, message: '项目负责人不能为空', trigger: 'blur' }],
|
||||
|
||||
})
|
||||
const subFormRules = reactive({
|
||||
@ -1082,7 +1083,7 @@ const printfClick = () =>{
|
||||
message.error("至少选择一项后,打印!")
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
for(var i = 0 ; i < clickItem.value.length ; i ++ ){
|
||||
var item = clickItem.value[i];
|
||||
if(item.id == null ){
|
||||
|
@ -177,7 +177,7 @@ const formData = ref({
|
||||
projectMaterialPlanId: undefined,
|
||||
goodsType: undefined,
|
||||
currencyType: 1,
|
||||
taxRatio: undefined,
|
||||
taxRatio: 13,
|
||||
status: 1,
|
||||
createTime: new Date(),
|
||||
description: undefined
|
||||
|
@ -247,12 +247,12 @@ const handleExport = async () => {
|
||||
}
|
||||
}
|
||||
const setDefaultDate = () => {
|
||||
queryParams.createTime = dayjs().startOf('day').format('YYYY-MM-DD HH:mm:ss')
|
||||
queryParams.createTime = dayjs().startOf('day').format('YYYY-MM-DD')
|
||||
|
||||
}
|
||||
/** 初始化 **/
|
||||
onMounted(async () => {
|
||||
await getList()
|
||||
setDefaultDate()
|
||||
await getList()
|
||||
})
|
||||
</script>
|
||||
|
@ -275,21 +275,21 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="estimatedPrice" min-width="200" align="center">
|
||||
|
||||
<template #header><span class="hl-table_header">*</span>暂估单价</template>
|
||||
<template #header><span class="hl-table_header">*</span>暂估总价</template>
|
||||
|
||||
<template #default="scope">
|
||||
<el-form-item :prop="`${scope.$index}.estimatedPrice`" :rules="subMatPlanFormRules.estimatedPrice" class="mb-0px!">
|
||||
<el-input-number style="width: 100%" v-model="scope.row.estimatedPrice" placeholder="暂估单价" @change="handleEstimatedPrice" :min="0" :precision="6" disabled />
|
||||
<el-input-number style="width: 100%" v-model="scope.row.estimatedPrice" placeholder="暂估总价" @change="handleEstimatedPrice" :min="0" :precision="6" disabled />
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="actualPrice" min-width="200" align="center">
|
||||
|
||||
<template #header>实际单价</template>
|
||||
<template #header>实际总价</template>
|
||||
|
||||
<template #default="scope">
|
||||
<el-form-item :prop="`${scope.$index}.actualPrice`" class="mb-0px!">
|
||||
<el-input-number style="width: 100%" v-model="scope.row.actualPrice" placeholder="实际单价" @change="handleActualPrice" :min="0" :precision="6" disabled />
|
||||
<el-input-number style="width: 100%" v-model="scope.row.actualPrice" placeholder="实际总价" @change="handleActualPrice" :min="0" :precision="6" disabled />
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -699,21 +699,21 @@ const formRules = reactive({
|
||||
})
|
||||
const subFormRules = reactive({
|
||||
matId: [{ required: true, message: '物料编码不能为空', trigger: 'blur' }],
|
||||
estimatedPrice: [{ required: true, message: '暂估单价不能为空', trigger: 'blur' }],
|
||||
estimatedPrice: [{ required: true, message: '暂估总价不能为空', trigger: 'blur' }],
|
||||
purchaseAmount: [{ required: true, message: '采购数量不能为空', trigger: 'blur' }]
|
||||
})
|
||||
const subBoomFormRules = reactive({
|
||||
boomName: [{ required: true, message: '零件名称不能为空', trigger: 'blur' }],
|
||||
boomPurchaseAmount: [{ required: true, message: '采购数量不能为空', trigger: 'blur' }],
|
||||
boomEstimatedPrice: [{ required: true, message: '暂估单价不能为空', trigger: 'blur' }]
|
||||
boomEstimatedPrice: [{ required: true, message: '暂估总价不能为空', trigger: 'blur' }]
|
||||
})
|
||||
const subMatPlanFormRules = reactive({
|
||||
purchaseAmount: [{ required: true, message: '采购数量不能为空', trigger: 'blur' }],
|
||||
estimatedPrice: [{ required: true, message: '暂估单价不能为空', trigger: 'blur' }]
|
||||
estimatedPrice: [{ required: true, message: '暂估总价不能为空', trigger: 'blur' }]
|
||||
})
|
||||
const subBoomPlanFormRules = reactive({
|
||||
boomPurchaseAmount: [{ required: true, message: '采购数量不能为空', trigger: 'blur' }],
|
||||
boomEstimatedPrice: [{ required: true, message: '暂估单价不能为空', trigger: 'blur' }]
|
||||
boomEstimatedPrice: [{ required: true, message: '暂估总价不能为空', trigger: 'blur' }]
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
const subFormRef = ref() // 表单 Ref
|
||||
|
@ -281,21 +281,21 @@
|
||||
|
||||
<el-table-column prop="estimatedPrice" min-width="200" align="center">
|
||||
|
||||
<template #header><span class="hl-table_header">*</span>暂估单价</template>
|
||||
<template #header><span class="hl-table_header">*</span>暂估总价</template>
|
||||
|
||||
<template #default="scope">
|
||||
<el-form-item :prop="`${scope.$index}.estimatedPrice`" :rules="subMatPlanFormRules.estimatedPrice" class="mb-0px!">
|
||||
<el-input-number style="width: 100%" v-model="scope.row.estimatedPrice" placeholder="暂估单价" @change="handleEstimatedPrice" :min="0" :precision="6" disabled />
|
||||
<el-input-number style="width: 100%" v-model="scope.row.estimatedPrice" placeholder="暂估总价" @change="handleEstimatedPrice" :min="0" :precision="6" disabled />
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="actualPrice" min-width="200" align="center">
|
||||
|
||||
<template #header>实际单价</template>
|
||||
<template #header>实际总价</template>
|
||||
|
||||
<template #default="scope">
|
||||
<el-form-item :prop="`${scope.$index}.actualPrice`" class="mb-0px!">
|
||||
<el-input-number style="width: 100%" v-model="scope.row.actualPrice" placeholder="实际单价" @change="handleEstimatedPrice" :min="0" :precision="6" disabled />
|
||||
<el-input-number style="width: 100%" v-model="scope.row.actualPrice" placeholder="实际总价" @change="handleEstimatedPrice" :min="0" :precision="6" disabled />
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -709,24 +709,24 @@ const formRules = reactive({
|
||||
})
|
||||
const subFormRules = reactive({
|
||||
matId: [{ required: true, message: '物料编码不能为空', trigger: 'blur' }],
|
||||
estimatedPrice: [{ required: true, message: '暂估单价不能为空', trigger: 'blur' }],
|
||||
estimatedPrice: [{ required: true, message: '暂估总价不能为空', trigger: 'blur' }],
|
||||
purchaseAmount: [{ required: true, message: '采购数量不能为空', trigger: 'blur' }]
|
||||
})
|
||||
const subBoomFormRules = reactive({
|
||||
boomName: [{ required: true, message: '零件名称不能为空', trigger: 'blur' }],
|
||||
composition: [{ required: true, message: '材质不能为空', trigger: 'blur' }],
|
||||
boomPurchaseAmount: [{ required: true, message: '采购数量不能为空', trigger: 'blur' }],
|
||||
boomEstimatedPrice: [{ required: true, message: '暂估单价不能为空', trigger: 'blur' }],
|
||||
boomEstimatedPrice: [{ required: true, message: '暂估总价不能为空', trigger: 'blur' }],
|
||||
boomArriveTime: [{ required: true, message: '预计到货时间不能为空', trigger: 'blur' }],
|
||||
})
|
||||
const subMatPlanFormRules = reactive({
|
||||
purchaseAmount: [{ required: true, message: '采购数量不能为空', trigger: 'blur' }],
|
||||
estimatedPrice: [{ required: true, message: '暂估单价不能为空', trigger: 'blur' }]
|
||||
estimatedPrice: [{ required: true, message: '暂估总价不能为空', trigger: 'blur' }]
|
||||
})
|
||||
const subBoomPlanFormRules = reactive({
|
||||
boomName: [{ required: true, message: '零件名称不能为空', trigger: 'blur' }],
|
||||
boomPurchaseAmount: [{ required: true, message: '采购数量不能为空', trigger: 'blur' }],
|
||||
boomEstimatedPrice: [{ required: true, message: '暂估单价不能为空', trigger: 'blur' }]
|
||||
boomEstimatedPrice: [{ required: true, message: '暂估总价不能为空', trigger: 'blur' }]
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
const subFormRef = ref() // 表单 Ref
|
||||
|
@ -281,7 +281,7 @@
|
||||
|
||||
<el-table-column prop="estimatedPrice" min-width="200" align="center">
|
||||
|
||||
<template #header><span class="hl-table_header">*</span>暂估单价</template>
|
||||
<template #header><span class="hl-table_header">*</span>暂估总价</template>
|
||||
|
||||
<template #default="scope">
|
||||
<el-form-item :prop="`${scope.$index}.estimatedPrice`" :rules="subMatPlanFormRules.estimatedPrice" class="mb-0px!">
|
||||
@ -291,11 +291,11 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="actualPrice" min-width="200" align="center">
|
||||
|
||||
<template #header>实际单价</template>
|
||||
<template #header>实际总价</template>
|
||||
|
||||
<template #default="scope">
|
||||
<el-form-item :prop="`${scope.$index}.actualPrice`" class="mb-0px!">
|
||||
<el-input-number style="width: 100%" v-model="scope.row.actualPrice" placeholder="实际单价" @change="handleEstimatedPrice" :min="0" :precision="6" :disabled="formData.status == 2 || formData.status == 3" />
|
||||
<el-input-number style="width: 100%" v-model="scope.row.actualPrice" placeholder="实际总价" @change="handleEstimatedPrice" :min="0" :precision="6" :disabled="formData.status == 2 || formData.status == 3" />
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -725,24 +725,24 @@ const formRules = reactive({
|
||||
})
|
||||
const subFormRules = reactive({
|
||||
matId: [{ required: true, message: '物料编码不能为空', trigger: 'blur' }],
|
||||
estimatedPrice: [{ required: true, message: '暂估单价不能为空', trigger: 'blur' }],
|
||||
estimatedPrice: [{ required: true, message: '暂估总价不能为空', trigger: 'blur' }],
|
||||
purchaseAmount: [{ required: true, message: '采购数量不能为空', trigger: 'blur' }]
|
||||
})
|
||||
const subBoomFormRules = reactive({
|
||||
boomName: [{ required: true, message: '零件名称不能为空', trigger: 'blur' }],
|
||||
composition: [{ required: true, message: '材质不能为空', trigger: 'blur' }],
|
||||
boomPurchaseAmount: [{ required: true, message: '采购数量不能为空', trigger: 'blur' }],
|
||||
boomEstimatedPrice: [{ required: true, message: '暂估单价不能为空', trigger: 'blur' }],
|
||||
boomEstimatedPrice: [{ required: true, message: '暂估总价不能为空', trigger: 'blur' }],
|
||||
boomArriveTime: [{ required: true, message: '预计到货时间不能为空', trigger: 'blur' }],
|
||||
})
|
||||
const subMatPlanFormRules = reactive({
|
||||
purchaseAmount: [{ required: true, message: '采购数量不能为空', trigger: 'blur' }],
|
||||
estimatedPrice: [{ required: true, message: '暂估单价不能为空', trigger: 'blur' }]
|
||||
estimatedPrice: [{ required: true, message: '暂估总价不能为空', trigger: 'blur' }]
|
||||
})
|
||||
const subBoomPlanFormRules = reactive({
|
||||
boomName: [{ required: true, message: '零件名称不能为空', trigger: 'blur' }],
|
||||
boomPurchaseAmount: [{ required: true, message: '采购数量不能为空', trigger: 'blur' }],
|
||||
boomEstimatedPrice: [{ required: true, message: '暂估单价不能为空', trigger: 'blur' }]
|
||||
boomEstimatedPrice: [{ required: true, message: '暂估总价不能为空', trigger: 'blur' }]
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
const subFormRef = ref() // 表单 Ref
|
||||
@ -768,7 +768,9 @@ const handleSelectedMaterialPlanMat = (arr) => {
|
||||
if (!existingMatIds.has(item.matId)) {
|
||||
item.description = '';
|
||||
item.matType=Number(item.matType)
|
||||
item.matUnit=Number(item.matUnit)
|
||||
item.boomUnit=Number(item.matUnit)
|
||||
item.boomName=item.matName
|
||||
item.boomSpec=item.matSpec
|
||||
console.log(item)
|
||||
formData.value.matItemDOList.push(item);
|
||||
existingMatIds.add(item.matId); // 将新添加的 matId 加入 Set
|
||||
@ -808,22 +810,22 @@ const handleSelectedMaterialPlanBoom =async (arrBoom) => {
|
||||
const handleEstimatedPrice = () => {
|
||||
let allEstimatePrice = 0
|
||||
formData.value.matItemDOList.forEach((item) => {
|
||||
allEstimatePrice += ((item.purchaseAmount==null || item.purchaseAmount==undefined)?0:item.purchaseAmount)*((item.estimatedPrice==null || item.estimatedPrice==undefined)?0:item.estimatedPrice)
|
||||
allEstimatePrice += ((item.estimatedPrice==null || item.estimatedPrice==undefined)?0:item.estimatedPrice)
|
||||
})
|
||||
|
||||
formData.value.boomItemDOList.forEach((item) => {
|
||||
allEstimatePrice += ((item.purchaseAmount==null || item.purchaseAmount==undefined)?0:item.purchaseAmount)*((item.estimatedPrice==null || item.estimatedPrice==undefined)?0:item.estimatedPrice)
|
||||
allEstimatePrice += ((item.estimatedPrice==null || item.estimatedPrice==undefined)?0:item.estimatedPrice)
|
||||
})
|
||||
|
||||
formData.value.estimatedPrice = allEstimatePrice
|
||||
|
||||
let allActualPrice = 0
|
||||
formData.value.matItemDOList.forEach((item) => {
|
||||
allActualPrice += ((item.purchaseAmount==null || item.purchaseAmount==undefined)?0:item.purchaseAmount)*((item.actualPrice==null || item.actualPrice==undefined)?0:item.actualPrice)
|
||||
allActualPrice += ((item.actualPrice==null || item.actualPrice==undefined)?0:item.actualPrice)
|
||||
})
|
||||
|
||||
formData.value.boomItemDOList.forEach((item) => {
|
||||
allActualPrice += ((item.purchaseAmount==null || item.purchaseAmount==undefined)?0:item.purchaseAmount)*((item.actualPrice==null || item.actualPrice==undefined)?0:item.actualPrice)
|
||||
allActualPrice += ((item.actualPrice==null || item.actualPrice==undefined)?0:item.actualPrice)
|
||||
})
|
||||
|
||||
formData.value.actualPrice = allActualPrice
|
||||
|
@ -103,31 +103,36 @@ label="单据日期" align="center" prop="createTime" :formatter="dateFormatter"
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="采购合同号" align="center" prop="contractNo" min-width="180" />
|
||||
<el-table-column label="结算币种" align="center" prop="currencyType" min-width="180">
|
||||
<el-table-column label="结算币种" align="center" prop="currencyType" min-width="100">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.HELI_CURRENCY" :value="scope.row.currencyType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="暂估价金额(元)" align="center" prop="estimatedPrice" min-width="180" />
|
||||
<el-table-column label="实际价金额(元)" align="center" prop="actualPrice" min-width="180" />
|
||||
<el-table-column label="暂估价金额(元)" align="center" prop="estimatedPrice" min-width="100" />
|
||||
<el-table-column label="实际价金额(元)" align="center" prop="actualPrice" min-width="100" />
|
||||
<el-table-column label="税率" align="center" prop="taxRatio" />
|
||||
<el-table-column label="备注" align="center" prop="description" />
|
||||
<el-table-column label="收货状态" align="center" prop="receivingStatus" fixed="right" min-width="180">
|
||||
<el-table-column label="收货状态" align="center" prop="receivingStatus" fixed="right" min-width="100">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.HELI_PURCHASE_RECEIVING_STATUS" :value="scope.row.receivingStatus" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单据状态" align="center" prop="status" fixed="right" min-width="180">
|
||||
<el-table-column label="单据状态" align="center" prop="status" fixed="right" min-width="100">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.HELI_PURCHASE_ORDER_STATUS" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="right" fixed="right" min-width="200">
|
||||
<el-table-column label="操作" align="right" fixed="right" min-width="220">
|
||||
<template #header>
|
||||
<span style="margin-right: 30%">操作</span>
|
||||
</template>
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
link type="primary" @click="isPrint( scope.row.id)"
|
||||
>
|
||||
打印
|
||||
</el-button>
|
||||
<el-button
|
||||
link type="primary" @click="openForm('edit', scope.row.id)"
|
||||
v-if="scope.row.status == 1 || scope.row.status == 4">
|
||||
编辑
|
||||
@ -158,9 +163,7 @@ import { dateFormatter, formatDate } from '@/utils/formatTime'
|
||||
import download from '@/utils/download'
|
||||
import * as PurchaseOrderApi from '@/api/heli/purchaseorder'
|
||||
import * as PurchaseOrderNoApi from '@/api/heli/purchaseorderno'
|
||||
import PurchaseOrderForm from './PurchaseOrderForm.vue'
|
||||
import { ElTable } from 'element-plus'
|
||||
import {getPurchaseOrderNoPage} from "@/api/heli/purchaseorderno";
|
||||
import dayjs from "dayjs";
|
||||
|
||||
defineOptions({ name: 'PurchaseOrder' })
|
||||
@ -275,13 +278,20 @@ const editReceivingStatus = async (id: number) => {
|
||||
// 提示用户是否保存入库信息
|
||||
await message.confirm('确认完成收货?')
|
||||
// 发起修改
|
||||
await PurchaseOrderApi.updateReceivingStatus(id)
|
||||
await PurchaseOrderNoApi.updateReceivingStatus(id)
|
||||
message.success(t('common.updateSuccess'))
|
||||
// 刷新列表
|
||||
await getList()
|
||||
} catch { }
|
||||
}
|
||||
|
||||
const isPrint = async (id) => {
|
||||
// var newVar = await PurchaseOrderNoApi.isPrint(id);
|
||||
// console.log(newVar)
|
||||
var newVar = await PurchaseOrderNoApi.countReview(id);
|
||||
console.log(newVar)
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (id: number) => {
|
||||
try {
|
||||
@ -331,12 +341,13 @@ const handleExportWithTax = async () => {
|
||||
}
|
||||
}
|
||||
const setDefaultDate = () => {
|
||||
queryParams.createTime = dayjs().startOf('day').format('YYYY-MM-DD HH:mm:ss')
|
||||
queryParams.createTime = dayjs().startOf('day').format('YYYY-MM-DD')
|
||||
|
||||
}
|
||||
/** 初始化 **/
|
||||
onMounted(async () => {
|
||||
await getList()
|
||||
setDefaultDate()
|
||||
await getList()
|
||||
|
||||
})
|
||||
</script>
|
||||
|
163
mes-ui/mes-ui-admin-vue3/src/views/heli/purchaseorderno/from.vue
Normal file
163
mes-ui/mes-ui-admin-vue3/src/views/heli/purchaseorderno/from.vue
Normal file
@ -0,0 +1,163 @@
|
||||
<template>
|
||||
<Dialog :title="dialogTitle" v-model="dialogVisible" width="500">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
label-width="100px"
|
||||
v-loading="formLoading"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item prop="whId" label="入库仓库">
|
||||
<el-select
|
||||
v-model="formData.whId" placeholder="下拉选择" clearable class="!w-400px" @change="handleWh">
|
||||
<el-option v-for="dict in whList" :key="dict.id" :label="dict.whName" :value="dict.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item prop="rgId" label="入库库区">
|
||||
<el-select
|
||||
v-model="formData.rgId" placeholder="下拉选择" style="width: 100%" @change="handleRg"
|
||||
>
|
||||
<el-option v-for="dict in rgList" :key="dict.id" :label="dict.rg_name" :value="dict.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item prop="pnId" label="入库库位">
|
||||
<el-select
|
||||
v-model="formData.pnId" placeholder="下拉选择" style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in pnList" :key="dict.id" :label="dict.pn_name"
|
||||
:value="dict.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item prop="storageAmount" label="入库数量">
|
||||
<el-input v-model="formData.storageAmount" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import * as RgApi from "@/api/heli/rg";
|
||||
import * as PnApi from "@/api/heli/pn";
|
||||
import * as WarehouseApi from "@/api/heli/warehouse";
|
||||
import * as StorageApi from '@/api/heli/storage'
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const dialogTitle = ref('采购入库') // 弹窗的标题
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||
const formData = ref({
|
||||
id: undefined,
|
||||
storageAmount: undefined,
|
||||
whId:undefined,
|
||||
rgId:undefined,
|
||||
pnId:undefined,
|
||||
purchaseOrderId:undefined,
|
||||
materialId:undefined,
|
||||
stockType:1,
|
||||
})
|
||||
|
||||
const formRef = ref() // 表单 Ref
|
||||
//仓库全数据
|
||||
const whList = ref([])
|
||||
//库区全数据
|
||||
const rgList = ref([])
|
||||
//库位全数据
|
||||
const pnList = ref([])
|
||||
const handleWh = async (wid) => {
|
||||
//-------------------库区全数据
|
||||
// 获得库区列表
|
||||
const dataRgList = await RgApi.getSimpList()
|
||||
const dataPnList = await PnApi.getSimpList()
|
||||
formData.value.rgId = '';
|
||||
formData.value.pnId = '';
|
||||
rgList.value = dataRgList.filter((rg) => rg.wh_id == wid)
|
||||
pnList.value = dataPnList.filter((pn) => pn.wh_id == wid)
|
||||
}
|
||||
const handleRg = async () => {
|
||||
//-------------------库位全数据
|
||||
const dataPnList = await PnApi.getSimpList()
|
||||
formData.value.pnId = '';
|
||||
console.log(formData.value.rgId)
|
||||
pnList.value= dataPnList.filter((pn) => pn.rg_id == formData.value.rgId)
|
||||
console.log(pnList.value)
|
||||
//-------------------
|
||||
}
|
||||
/** 打开弹窗 */
|
||||
const open = async (id: number, purchaseOrderId: number,num:number,materialId:number) => {
|
||||
dialogVisible.value = true
|
||||
resetForm()
|
||||
formData.value.id=id;
|
||||
formData.value.purchaseOrderId=purchaseOrderId;
|
||||
formData.value.storageAmount=num;
|
||||
formData.value.materialId=materialId;
|
||||
console.log(formData.value)
|
||||
//- 获取仓库全数据
|
||||
whList.value = await WarehouseApi.getWarehouseSimpList()
|
||||
|
||||
if (whList.value.length==1){
|
||||
formData.value.whId = whList.value[0].id;
|
||||
const dataRgList = await RgApi.getSimpList()
|
||||
rgList.value = dataRgList.filter((rg) => rg.wh_id == formData.value.whId)
|
||||
// 获得库区列表
|
||||
const dataPnList = await PnApi.getSimpList()
|
||||
|
||||
pnList.value = dataPnList.filter((pn) => pn.wh_id == formData.value.whId)
|
||||
}
|
||||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
/** 提交表单 */
|
||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||
const submitForm = async () => {
|
||||
// 校验表单
|
||||
await formRef.value.validate()
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
await StorageApi.procurementAndStorage(formData.value)
|
||||
message.success("采购入库成功");
|
||||
dialogVisible.value = false
|
||||
// 发送操作成功的事件
|
||||
emit('success')
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 重置表单 */
|
||||
const resetForm = () => {
|
||||
formData.value = {
|
||||
id: undefined,
|
||||
storageAmount: undefined,
|
||||
whId:undefined,
|
||||
rgId:undefined,
|
||||
pnId:undefined,
|
||||
purchaseOrderId:undefined,
|
||||
materialId:undefined,
|
||||
stockType:1,
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
</script>
|
@ -111,7 +111,7 @@ v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true" cl
|
||||
<span style="margin-right: 30%">操作</span>
|
||||
</template>
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" @click="warehousing(scope.row.id)" v-if="scope.row.purchaseAmount>scope.row.boomAmount&&scope.row.purchaseRemAmount>0">
|
||||
<el-button link type="primary" @click="warehousing(scope.row.id,scope.row.purchaseOrderId,scope.row.purchaseRemAmount,scope.row.materialId)" v-if="scope.row.purchaseAmount>scope.row.boomAmount&&scope.row.purchaseRemAmount>0">
|
||||
采购入库
|
||||
</el-button>
|
||||
</template>
|
||||
@ -127,6 +127,8 @@ v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true" cl
|
||||
</el-row>
|
||||
</el-card>
|
||||
</el-card>
|
||||
<Storage ref="formRef" @success="getList" />
|
||||
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@ -137,6 +139,7 @@ import * as StorageinApi from '@/api/heli/storagein'
|
||||
import { ElTable } from 'element-plus'
|
||||
import {ref} from "vue";
|
||||
import {dateFormatter2} from "@/utils/formatTime";
|
||||
import Storage from './from.vue'
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
defineOptions({ name: 'PurchaseOrder' })
|
||||
const message = useMessage() // 消息弹窗
|
||||
@ -178,6 +181,8 @@ const queryParams = reactive({
|
||||
const queryFormRef = ref() // 搜索的表单
|
||||
const exportLoading = ref(false) // 导出的加载中
|
||||
const multipleTable = ref<InstanceType<typeof ElTable>>()
|
||||
/** 添加/修改操作 */
|
||||
const formRef = ref()
|
||||
|
||||
/** 查询列表 */
|
||||
const getList = async () => {
|
||||
@ -212,9 +217,12 @@ const multipleSelection: any = ref([])
|
||||
|
||||
|
||||
|
||||
const warehousing = async (id) => {
|
||||
const warehousing = async (id,purchaseOrderId,purchaseRemAmount,materialId) => {
|
||||
await StorageinApi.warehousing(id)
|
||||
message.success("采购入库成功")
|
||||
formRef.value.open( id,purchaseOrderId,purchaseRemAmount,materialId)
|
||||
|
||||
// message.success("采购入库成功")
|
||||
|
||||
await getList()
|
||||
}
|
||||
const standardPartsReceived = async () => {
|
||||
|
Loading…
Reference in New Issue
Block a user