feat(inventory): 增加订单类型字段支持

- 在出库相关组件和接口中新增 orderType 字段传递与处理逻辑
- 调整导入功能根据订单类型决定是否弹出采购单选择框
- 更新出库表单提交时携带订单类型参数
- 后端实体类 InventoryOuter 和 ProjectOrderInfo 新增 orderType 属性
- 数据库映射文件同步增加 order_type 字段查询与插入支持
- 优化税率计算逻辑,防止空指针异常
- 调整页面布局以容纳订单类型下拉选择框
- 修复前端字典加载及日期格式显示问题
master
chenhao 2025-12-08 17:40:15 +08:00
parent 675c1f3b95
commit b4984e6e4b
10 changed files with 32 additions and 6 deletions

View File

@ -84,6 +84,7 @@
import { addDelivery, listProductSn } from '@/api/inventory/delivery';
import {importSnData,exportDownloadTemplate} from '@/api/inventory/outer'
import PurchaseOrderSelectDialog from '../../../purchaseorder/components/PurchaseOrderSelectDialog.vue';
import {handleTree} from "@/utils/ruoyi";
export default {
name: "GenerateDeliveryForm",
@ -176,7 +177,12 @@ export default {
});
},
handleSelectPurchaseBeforeImport() {
this.purchaseOrderSelectVisible = true;
if ((this.productData.orderType || '1') === '1') {
this.purchaseOrderSelectVisible = true;
}else{
this.handleImport()
}
},
handlePurchaseOrderSelect(order) {
this.warehouseId = order.warehouseId;
@ -198,6 +204,7 @@ export default {
formData.append('file', file);
formData.append('productCode', this.productData.productCode);
formData.append('quantity', this.queryParams.pageSize);
formData.append('orderType', this.productData.orderType);
importSnData(formData).then(response => {
this.$message.success('导入成功');

View File

@ -61,11 +61,18 @@
<el-input v-model="localOrderData.orderCode" placeholder="自动生成" readonly :disabled="isReadonly"/>
</el-form-item>
</el-col>
<el-col :span="16">
<el-col :span="8">
<el-form-item label="执行单截止时间" prop="orderEndTime">
<el-date-picker v-model="localOrderData.orderEndTime" type="date" value-format="yyyy-MM-dd" placeholder="审批完成后自动计算" disabled></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="订单类型" prop="orderType">
<el-select v-model="localOrderData.orderType" :disabled="isReadonly">
<el-option v-for="dict in dict.type.delivery_order_type" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="币种" prop="currencyType">
<el-select v-model="localOrderData.currencyType" placeholder="请选择币种" :disabled="isReadonly">
@ -227,6 +234,7 @@ export default {
default: false
}
},
dicts:['delivery_order_type'],
data() {
return {
localOrderData: {},

View File

@ -50,6 +50,7 @@ public class InventoryOuter extends BaseEntity
@Excel(name = "产品型号")
private String model;
private String vendorName;
private String orderType;
private List<String> productCodeList;
/** 数量 */

View File

@ -67,7 +67,7 @@ public class OmsInventoryInner extends BaseEntity {
private String warehouseType;
@Excel(name = "经办人")
private String createByName;
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@Excel(name = "入库时间",dateFormat="yyyy-MM-dd HH:mm:ss")
private Date createTime;

View File

@ -61,6 +61,7 @@ public class ProjectOrderInfo extends BaseEntity {
private String customerCode;
private String customerPhone;
private String customerUserName;
private String orderType;
/**
*

View File

@ -278,6 +278,7 @@ public class InventoryOuterServiceImpl implements IInventoryOuterService
vo.setQuantity(item.getQuantity());
vo.setDeliveryGenerateQuantity(0L);
vo.setDeliveryConfirmQuantity(0L);
vo.setOrderType(inventoryOuter.getOrderType());
List<InventoryDelivery> tempDeliveryList = deliveryListMap.get(vo.getWarehouseId());
if (CollUtil.isNotEmpty(tempDeliveryList)){
for (InventoryDelivery inventoryDelivery : tempDeliveryList) {

View File

@ -246,7 +246,8 @@ public class OmsInventoryInnerServiceImpl implements IOmsInventoryInnerService {
// omsInventoryInner.setTaxTotal(inventoryInfoList.stream().map(item->
// item.getInnerPrice().divide(BigDecimal.ONE.add(item.getTaxRate()),2, RoundingMode.HALF_UP)
// ).reduce(BigDecimal.ZERO, BigDecimal::add));
BigDecimal divide = omsInventoryInner.getTotalAmount().divide(BigDecimal.ONE.add(omsInventoryInner.getTaxRate()), 2, RoundingMode.HALF_UP);
BigDecimal taxRate = omsInventoryInner.getTaxRate()==null?new BigDecimal("0.13"):omsInventoryInner.getTaxRate();
BigDecimal divide = omsInventoryInner.getTotalAmount().divide(BigDecimal.ONE.add(taxRate), 2, RoundingMode.HALF_UP);
omsInventoryInner.setTaxTotal(omsInventoryInner.getTotalAmount().subtract(divide));

View File

@ -26,6 +26,7 @@ public class OuterDeliveryProductVo {
private Long deliveryConfirmQuantity;
private Long availableCount;
private String warehouseName;
private String orderType;
private Long warehouseId;
}

View File

@ -125,6 +125,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
t1.update_time,
t2.model,
t3.vendor_name,
t4.order_type,
t5.project_name,
t5.project_code
from oms_inventory_outer t1

View File

@ -44,13 +44,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
shipment_amount, actual_purchase_amount, order_end_time, delivery_time, company_delivery, notifier,finance_status,
notifier_email, notifier_phone, duty, duty_email, duty_phone, order_channel, partner_code, supplier,notifier_address,
remark, order_status, create_by, create_time, update_by, update_time,version_code,process_type,process_template,discount_fold,
delivery_status,sign_status,outer_status,approve_time,payment_method,payment_ratio,payment_description
delivery_status,sign_status,outer_status,approve_time,payment_method,payment_ratio,payment_description,order_type
from project_order_info t1
</sql>
<sql id="selectProjectOrderInfoRelationVo">
select t1.id, t1.project_id,t1.province, t1.city, t1.business_person, t1.business_email, t1.business_phone, t1.order_code, t1.currencyType,
t1.shipment_amount, t1.actual_purchase_amount, t1.order_end_time, t1.delivery_time, t1.company_delivery, t1.notifier,
t1.shipment_amount, t1.actual_purchase_amount, t1.order_end_time, t1.delivery_time, t1.company_delivery, t1.notifier,t1.order_tpye,
t1.notifier_email, t1.notifier_phone, t1.duty, t1.duty_email, t1.duty_phone, t1.order_channel, t1.partner_code, t1.supplier,
t1.remark, t1.order_status, t1.create_by, t1.create_time, t1.update_by, t1.update_time,t1.partner_user_name,t1.partner_email
,t1.partner_phone,t1.version_code,t1.process_type,t1.process_template,t1.discount_fold,t1.notifier_address,t1.finance_status,
@ -491,6 +491,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="notifierPhone != null">notifier_phone,</if>
<if test="notifierAddress != null">notifier_address,</if>
<if test="duty != null">duty,</if>
<if test="orderType != null and orderType!=''">order_type,</if>
<if test="dutyEmail != null">duty_email,</if>
<if test="dutyPhone != null">duty_phone,</if>
<if test="orderChannel != null">order_channel,</if>
@ -532,6 +533,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="notifierPhone != null">#{notifierPhone},</if>
<if test="notifierAddress != null">#{notifierAddress},</if>
<if test="duty != null">#{duty},</if>
<if test="orderType != null and orderType!=''">#{orderType},</if>
<if test="dutyEmail != null">#{dutyEmail},</if>
<if test="dutyPhone != null">#{dutyPhone},</if>
<if test="orderChannel != null">#{orderChannel},</if>
@ -595,6 +597,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update_time,
process_type,
process_template,
order_type,
discount_fold)
select id,
project_id,
@ -636,6 +639,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update_time,
process_type,
process_template,
order_type,
discount_fold
from project_order_info
where order_code = #{orderCode}
@ -647,6 +651,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="projectId != null">project_id = #{projectId},</if>
<if test="province != null">province = #{province},</if>
<if test="city != null">city = #{city},</if>
<if test="orderType != null and orderType!=''">order_type=#{orderType},</if>
<if test="businessPerson != null">business_person = #{businessPerson},</if>
<if test="businessEmail != null">business_email = #{businessEmail},</if>
<if test="businessPhone != null">business_phone = #{businessPhone},</if>