feat(inventory): 实现采购订单和服务入库功能
- 修改PO订单入库和服务入库按钮点击事件,传递不同参数以区分入库类型 - 在采购订单选择对话框中增加产品类型过滤功能,支持按不同类型筛选采购订单 - 新增采购订单选择对话框组件,用于展示和选择符合条件的采购订单 - 优化后端SQL查询逻辑,支持根据产品类型列表进行筛选 - 完善采购订单更新逻辑,支持更多字段的动态更新 - 处理公司领导审批完成后,针对线下流程类型的订单自动设置确认状态 - 修复操作日志查询中businessTypes判断逻辑错误,确保正确过滤业务类型dev_1.0.0
parent
5f3c8b3463
commit
9556a2d6d9
|
|
@ -31,12 +31,12 @@
|
|||
<!-- 操作按钮 -->
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" @click="handleAdd" v-hasPermi="['inventory:inner:add']">
|
||||
<el-button type="primary" plain icon="el-icon-plus" @click="handleAdd()" v-hasPermi="['inventory:inner:add']">
|
||||
PO订单入库
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" @click="handleAdd" v-hasPermi="['inventory:inner:add']">
|
||||
<el-button type="primary" plain icon="el-icon-plus" @click="handleAdd('maintenance')" v-hasPermi="['inventory:inner:add']">
|
||||
服务入库
|
||||
</el-button>
|
||||
</el-col>
|
||||
|
|
@ -78,7 +78,7 @@
|
|||
|
||||
<pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList"/>
|
||||
|
||||
<purchase-order-select-dialog :visible.sync="purchaseOrderSelectVisible" @select="handlePurchaseOrderSelect"/>
|
||||
<purchase-order-select-dialog :visible.sync="purchaseOrderSelectVisible" :productTypeList="queryProductType" @select="handlePurchaseOrderSelect"/>
|
||||
|
||||
<!-- 新增/修改 Dialog -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="80%" append-to-body :close-on-click-modal="false">
|
||||
|
|
@ -347,6 +347,7 @@ export default {
|
|||
open: false,
|
||||
snRow: {},
|
||||
snOpen: false,
|
||||
queryProductType:[],
|
||||
snTitle: '添加SN码',
|
||||
snLabel: '该批次起始SN码',
|
||||
snInput: false,
|
||||
|
|
@ -492,8 +493,13 @@ export default {
|
|||
this.resetForm("form");
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
handleAdd(type) {
|
||||
this.reset();
|
||||
if (type==='maintenance'){
|
||||
this.queryProductType=['11','22']
|
||||
}else{
|
||||
this.queryProductType=['1','2','99']
|
||||
}
|
||||
this.purchaseOrderSelectVisible = true;
|
||||
},
|
||||
handlePurchaseOrderSelect(order) {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,152 @@
|
|||
<template>
|
||||
<el-dialog :title="title" :visible.sync="visible" width="80%" append-to-body @close="handleClose">
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="120px">
|
||||
<el-form-item label="采购单号" prop="purchaseNo">
|
||||
<el-input
|
||||
v-model="queryParams.purchaseNo"
|
||||
placeholder="请输入采购单号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="采购方名称" prop="buyerName">
|
||||
<el-input
|
||||
v-model="queryParams.buyerName"
|
||||
placeholder="请输入采购方名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="制造商名称" prop="vendorName">
|
||||
<el-input
|
||||
v-model="queryParams.vendorName"
|
||||
placeholder="请输入制造商名称"
|
||||
clearable
|
||||
@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-table v-loading="loading" @row-click="handleSelect" :data="purchaseorderList" >
|
||||
<el-table-column label="采购单号" align="center" prop="purchaseNo" width="180"/>
|
||||
<el-table-column label="采购方名称" align="center" prop="buyerName" width="220"/>
|
||||
<el-table-column label="制造商名称" align="center" prop="vendorName" width="120"/>
|
||||
<el-table-column label="联系人" align="center" prop="vendorUser" width="100"/>
|
||||
<el-table-column label="联系电话" align="center" prop="vendorPhone" width="120"/>
|
||||
<el-table-column label="发起日期" align="center" prop="createTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="汇智负责人" align="center" prop="ownerName" width="120"/>
|
||||
<el-table-column label="产品类型" align="center" prop="productType" width="100">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.product_type" :value="scope.row.productType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="产品编码" align="center" prop="productCode" width="100"/>
|
||||
<el-table-column label="产品型号" align="center" prop="productModel" width="100"/>
|
||||
<el-table-column label="数量" align="center" prop="quantity" width="100"/>
|
||||
<el-table-column label="单件" align="center" prop="price" width="100"/>
|
||||
<el-table-column label="小计" align="center" prop="price" width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.quantity * scope.row.price}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {listPurchaseorder, listPurchaseOrderItem} from "@/api/sip/purchaseorder";
|
||||
|
||||
export default {
|
||||
name: "PurchaseOrderSelectDialog",
|
||||
props: {
|
||||
visible: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
productTypeList:{
|
||||
type:Array,
|
||||
default: []
|
||||
}
|
||||
},
|
||||
dicts:['product_type'],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 采购单主表表格数据
|
||||
purchaseorderList: [],
|
||||
// 弹出层标题
|
||||
title: "选择采购单",
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
purchaseNo: null,
|
||||
buyerName: null,
|
||||
productTypeList: [],
|
||||
vendorName: null,
|
||||
approveStatus: '2', // 只查询审批通过的
|
||||
confirmStatus:'1'
|
||||
},
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
visible(val) {
|
||||
if (val) {
|
||||
this.getList();
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/** 查询采购单主表列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
this.queryParams.productTypeList = this.productTypeList;
|
||||
listPurchaseOrderItem(this.queryParams).then(response => {
|
||||
this.purchaseorderList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
handleSelect(row) {
|
||||
this.$emit("select", row);
|
||||
this.handleClose();
|
||||
},
|
||||
handleClose() {
|
||||
this.$emit("update:visible", false);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
@ -7,6 +7,7 @@ import lombok.Data;
|
|||
import lombok.ToString;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author : ch
|
||||
|
|
@ -36,4 +37,5 @@ public class OmsPurchaseOrderItemDto extends OmsPurchaseOrder {
|
|||
private String productType;
|
||||
private String productModel;
|
||||
private String productDesc;
|
||||
private List<String> productTypeList;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -401,9 +401,14 @@ public class OmsPurchaseOrderServiceImpl implements IOmsPurchaseOrderService, To
|
|||
}
|
||||
|
||||
private void handleCompanyLeaderApproval(String businessKey) {
|
||||
OmsPurchaseOrder existOrder = omsPurchaseOrderMapper.selectByNo(businessKey);
|
||||
|
||||
OmsPurchaseOrder omsPurchaseOrder = new OmsPurchaseOrder();
|
||||
omsPurchaseOrder.setPurchaseNo(businessKey);
|
||||
omsPurchaseOrder.setApproveStatus(ApproveStatusEnum.APPROVE_COMPLETE.getCode());
|
||||
if (existOrder.getFlowType().equalsIgnoreCase(OmsPurchaseOrder.FlowTypeEnum.OFFLINE.getValue())){
|
||||
omsPurchaseOrder.setConfirmStatus(OmsPurchaseOrder.ConfirmStatusEnum.CONFIRM.getCode());
|
||||
}
|
||||
omsPurchaseOrder.setApproveTime(DateUtils.getNowDate());
|
||||
omsPurchaseOrder.setUpdateTime(DateUtils.getNowDate());
|
||||
omsPurchaseOrderMapper.updateOmsPurchaseOrderByCode(omsPurchaseOrder);
|
||||
|
|
|
|||
|
|
@ -150,34 +150,41 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</select>
|
||||
<select id="listItem" resultType="com.ruoyi.sip.dto.inventory.OmsPurchaseOrderItemDto">
|
||||
SELECT
|
||||
t2.purchase_no,
|
||||
t2.buyer_name,
|
||||
t4.vendor_code,
|
||||
t4.vendor_name,
|
||||
t4.vendor_user,
|
||||
t4.vendor_phone,
|
||||
t2.create_time,
|
||||
t2.owner_name,
|
||||
t3.type as product_type,
|
||||
t1.product_code,
|
||||
t3.model as product_model,
|
||||
t1.inner_quantity,
|
||||
t1.quantity,
|
||||
t1.price,
|
||||
t1.amount_total,
|
||||
t2.warehouse_id,
|
||||
t3.description as product_desc
|
||||
t2.purchase_no,
|
||||
t2.buyer_name,
|
||||
t4.vendor_code,
|
||||
t4.vendor_name,
|
||||
t4.vendor_user,
|
||||
t4.vendor_phone,
|
||||
t2.create_time,
|
||||
t2.owner_name,
|
||||
t3.type as product_type,
|
||||
t1.product_code,
|
||||
t3.model as product_model,
|
||||
t1.inner_quantity,
|
||||
t1.quantity,
|
||||
t1.price,
|
||||
t1.amount_total,
|
||||
t2.warehouse_id,
|
||||
t3.description as product_desc
|
||||
|
||||
FROM
|
||||
oms_purchase_order_item t1
|
||||
LEFT JOIN oms_purchase_order t2 ON t1.purchase_id = t2.id
|
||||
left join product_info t3 on t1.product_code=t3.product_code
|
||||
left join oms_vendor_info t4 on t2.vendor_id=t4.vendor_id
|
||||
oms_purchase_order_item t1
|
||||
LEFT JOIN oms_purchase_order t2 ON t1.purchase_id = t2.id
|
||||
left join product_info t3 on t1.product_code=t3.product_code
|
||||
left join oms_vendor_info t4 on t2.vendor_id=t4.vendor_id
|
||||
<where>
|
||||
<if test="purchaseNo != null and purchaseNo != ''">and t2.purchase_no = #{purchaseNo}</if>
|
||||
<if test="productCode != null and productCode != '' ">and t1.product_code = #{productCode}</if>
|
||||
<if test="productType != null">and t3.type = #{productType}</if>
|
||||
<if test="vendorName != null and vendorName != ''">and t4.vendor_name = #{vendorName}</if>
|
||||
<if test="approveStatus != null and approveStatus != ''">and t2.approve_status = #{approveStatus}</if>
|
||||
<if test="confirmStatus != null and confirmStatus != ''">and t2.confirm_status = #{confirmStatus}</if>
|
||||
<if test="productTypeList != null and productTypeList.size>0">and t3.type in
|
||||
<foreach item="item" collection="productTypeList" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
|
||||
|
||||
|
|
@ -305,12 +312,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</update>
|
||||
<update id="updateOmsPurchaseOrderByCode">
|
||||
update oms_purchase_order
|
||||
<set>
|
||||
|
||||
</set>
|
||||
set approve_status = #{approveStatus},
|
||||
approve_time = #{approveTime},
|
||||
update_time = #{updateTime}
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="purchaseNo != null">purchase_no = #{purchaseNo},</if>
|
||||
<if test="buyerName != null">buyer_name = #{buyerName},</if>
|
||||
<if test="buyerAddress != null">buyer_address = #{buyerAddress},</if>
|
||||
<if test="vendorId != null">vendor_id = #{vendorId},</if>
|
||||
<if test="currency != null">currency = #{currency},</if>
|
||||
<if test="purchaserId != null">purchaser_id = #{purchaserId},</if>
|
||||
<if test="purchaserName != null">purchaser_name = #{purchaserName},</if>
|
||||
<if test="purchaserMobile != null">purchaser_mobile = #{purchaserMobile},</if>
|
||||
<if test="purchaserEmail != null">purchaser_email = #{purchaserEmail},</if>
|
||||
<if test="warehouseId != null">warehouse_id = #{warehouseId},</if>
|
||||
<if test="payMethod != null">pay_method = #{payMethod},</if>
|
||||
<if test="ownerId != null">owner_id = #{ownerId},</if>
|
||||
<if test="ownerName != null">owner_name = #{ownerName},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="totalAmount != null">total_amount = #{totalAmount},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="approveStatus != null">approve_status = #{approveStatus},</if>
|
||||
<if test="approveTime != null">approve_time = #{approveTime},</if>
|
||||
<if test="approveNode != null">approve_node = #{approveNode},</if>
|
||||
<if test="confirmStatus != null">confirm_status = #{confirmStatus},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="version != null">version = #{version},</if>
|
||||
<if test="flowType != null">flow_type=#{flowType},</if>
|
||||
</trim>
|
||||
where purchase_no = #{purchaseNo}
|
||||
</update>
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="businessType != null">
|
||||
AND business_type = #{businessType}
|
||||
</if>
|
||||
<if test="businessTypes != null and businessTypes.length > 0">
|
||||
<if test="businessTypes != null and businessTypes.size > 0">
|
||||
AND business_type in
|
||||
<foreach collection="businessTypes" item="businessType" open="(" separator="," close=")">
|
||||
#{businessType}
|
||||
|
|
|
|||
Loading…
Reference in New Issue