feat(tsoorder): 更新订单项状态字段和查询逻辑

This commit is contained in:
zxy 2026-04-16 17:18:02 +08:00
parent 32e02d109f
commit 1348aa4451
4 changed files with 55 additions and 46 deletions

View File

@ -4,33 +4,33 @@
<select id="getOrderItemWithOrder" resultType="jnpf.model.order.OrderItemWithOrderVO"> <select id="getOrderItemWithOrder" resultType="jnpf.model.order.OrderItemWithOrderVO">
SELECT SELECT
od.id AS itemId, od.id AS itemId,
od.sale_ord_id AS saleOrdId, od.sale_ord_id AS saleOrdId,
od.ord_item_status AS ordItemStatus, od.ord_item_status AS ordItemStatus,
od.ord_qty AS ordQty, od.ord_qty AS ordQty,
od.produce_qty AS produceQty, od.produce_qty AS produceQty,
(od.ord_qty - IFNULL(od.produce_qty, 0)) AS remainingQty, (od.ord_qty - IFNULL(od.produce_qty, 0)) AS remainingQty,
od.material_name AS materialName, od.material_name AS materialName,
od.unit AS unit, od.unit AS unit,
od.spec AS spec, od.spec AS spec,
od.deliveried_qty AS deliveriedQty, od.deliveried_qty AS deliveriedQty,
od.material_code AS materialCode, od.material_code AS materialCode,
od.price_tax AS priceTax, od.price_tax AS priceTax,
od.material_use AS materialUse, od.material_use AS materialUse,
od.remark AS remark, od.remark AS remark,
od.f_creator_user_id AS creatorUserId, od.f_creator_user_id AS creatorUserId,
eo.is_urgent AS isUrgent, eo.is_urgent AS isUrgent,
eo.contract_no AS contractNo, eo.contract_no AS contractNo,
eo.sale_ord_no AS saleOrdNo, eo.sale_ord_no AS saleOrdNo,
eo.cust_name AS custName, eo.cust_name AS custName,
eo.ord_type AS ordType, eo.ord_type AS ordType,
eo.ord_status AS ordStatus, eo.ord_status AS ordStatus,
eo.pro_status AS proStatus, eo.pro_status AS proStatus,
eo.ord_date AS ordDate, eo.ord_date AS ordDate,
eo.req_delivery_date AS reqDeliveryDate, eo.req_delivery_date AS reqDeliveryDate,
eo.payment_terms AS paymentTerms, eo.payment_terms AS paymentTerms,
eo.tax_rate AS taxRate, eo.tax_rate AS taxRate,
eo.ord_status AS ordStatus eo.ord_status AS ordStatus
FROM tso_order_item od FROM tso_order_item od
LEFT JOIN tso_order eo ON od.sale_ord_id = eo.id LEFT JOIN tso_order eo ON od.sale_ord_id = eo.id
<where> <where>
@ -39,7 +39,6 @@
AND eo.pro_status &lt;&gt; '2' AND eo.pro_status &lt;&gt; '2'
AND od.ord_item_status NOT IN ('2','9') AND od.ord_item_status NOT IN ('2','9')
AND eo.ord_status = '3' AND eo.ord_status = '3'
<if test="pagination.ordDateStart != null"> <if test="pagination.ordDateStart != null">
AND eo.ord_date &gt;= #{pagination.ordDateStart} AND eo.ord_date &gt;= #{pagination.ordDateStart}
</if> </if>
@ -52,11 +51,11 @@
<if test="pagination.custName != null and pagination.custName != ''"> <if test="pagination.custName != null and pagination.custName != ''">
AND eo.cust_name LIKE CONCAT('%', #{pagination.custName}, '%') AND eo.cust_name LIKE CONCAT('%', #{pagination.custName}, '%')
</if> </if>
<if test="pagination.proStatus == null or pagination.proStatus == ''"> <if test="pagination.ordItemStatus == null or pagination.ordItemStatus == ''">
AND eo.pro_status IN ('1', '0') AND od.ord_item_status IN ('1', '0')
</if> </if>
<if test="pagination.proStatus != null and pagination.proStatus != ''"> <if test="pagination.ordItemStatus != null and pagination.ordItemStatus != ''">
AND eo.pro_status = #{pagination.proStatus} AND od.ord_item_status = #{pagination.ordItemStatus}
</if> </if>
</where> </where>
ORDER BY eo.ord_date DESC, od.id DESC ORDER BY eo.ord_date DESC, od.id DESC

View File

@ -1,7 +1,7 @@
package jnpf.model.order; package jnpf.model.order;
import jnpf.base.Pagination;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import jnpf.base.Pagination;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.util.Date;
@ -22,6 +22,6 @@ public class OrderItemWithOrderPagination extends Pagination {
private String custName; private String custName;
@Schema(description = "行状态") @Schema(description = "行状态")
private String proStatus; private String ordItemStatus;
} }

View File

@ -4,6 +4,8 @@
export const dictMaps = { export const dictMaps = {
// 生产状态 // 生产状态
proStatus: { '0': '正常', '1': '部分转生产', '2': '全部转生产' }, proStatus: { '0': '正常', '1': '部分转生产', '2': '全部转生产' },
// 行状态
orderItemStatus: { '0': '正常', '1': '部分转产', '2': '全部转产', '9': '关闭' },
}; };
// 根据映射自动生成下拉选项 // 根据映射自动生成下拉选项

View File

@ -22,11 +22,11 @@
<el-col :span="6"> <el-col :span="6">
<el-form-item label="生产状态"> <el-form-item label="生产状态">
<JnpfSelect <JnpfSelect
v-model="query.proStatus" v-model="query.ordItemStatus"
placeholder="请选择生产状态" placeholder="请选择生产状态"
clearable clearable
:options="generateStatusOptions" :options="ordItemStatusOptions"
:props="generateStatusProps" :props="ordItemStatusProps"
> >
</JnpfSelect> </JnpfSelect>
</el-form-item> </el-form-item>
@ -104,10 +104,15 @@
{{ scope.row.unit == '1' ? 'kg' : scope.row.unit == '2' ? 'T' : scope.row.unit }} {{ scope.row.unit == '1' ? 'kg' : scope.row.unit == '2' ? 'T' : scope.row.unit }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="proStatus" label="生产状态" align="center" min-width="100"> <!-- <el-table-column prop="proStatus" label="生产状态" align="center" min-width="100">
<template slot-scope="scope"> <template slot-scope="scope">
{{ getLabel('proStatus', scope.row.proStatus) }} {{ getLabel('proStatus', scope.row.proStatus) }}
</template> </template>
</el-table-column> -->
<el-table-column prop="ordItemStatus" label="生产状态" align="center" min-width="100">
<template slot-scope="scope">
{{ getLabel('orderItemStatus', scope.row.ordItemStatus) }}
</template>
</el-table-column> </el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="150"> <el-table-column label="操作" fixed="right" align="center" width="150">
<template slot-scope="scope"> <template slot-scope="scope">
@ -140,10 +145,9 @@ export default {
query: { query: {
ordDate: undefined, ordDate: undefined,
saleOrdNo: undefined, saleOrdNo: undefined,
proStatus: undefined, ordItemStatus: undefined,
custName: undefined, custName: undefined,
}, },
queryData: {},
list: [], list: [],
listLoading: false, listLoading: false,
total: 0, total: 0,
@ -151,8 +155,8 @@ export default {
currentPage: 1, currentPage: 1,
pageSize: 20, pageSize: 20,
}, },
generateStatusOptions: [], ordItemStatusOptions: [],
generateStatusProps: { label: "fullName", value: "enCode" }, ordItemStatusProps: { label: "fullName", value: "enCode" },
ordStatusOptions: [], ordStatusOptions: [],
}; };
}, },
@ -163,7 +167,6 @@ export default {
...mapGetters(["userInfo"]), ...mapGetters(["userInfo"]),
}, },
created() { created() {
this.queryData = JSON.parse(JSON.stringify(this.query));
this.initDictData(); this.initDictData();
this.initSearchData(); this.initSearchData();
this.initData(); this.initData();
@ -179,8 +182,8 @@ export default {
getDictionaryDataSelector("811520443046428805").then((res) => { getDictionaryDataSelector("811520443046428805").then((res) => {
this.ordStatusOptions = res.data.list || []; this.ordStatusOptions = res.data.list || [];
}); });
// 使 // 使
this.generateStatusOptions = dictOptions.proStatus; this.ordItemStatusOptions = dictOptions.orderItemStatus;
}, },
initData() { initData() {
@ -216,7 +219,12 @@ export default {
}, },
reset() { reset() {
this.query = JSON.parse(JSON.stringify(this.queryData)); this.query = {
ordDate: undefined,
saleOrdNo: undefined,
ordItemStatus: undefined,
custName: undefined,
};
this.initSearchData(); this.initSearchData();
this.search(); this.search();
}, },