From 615d0a9e2011510b589ccc3b4bc58894a39e8295 Mon Sep 17 00:00:00 2001
From: 廖井涛 <2265517004@qq.com>
Date: 星期五, 05 七月 2024 10:17:03 +0800
Subject: [PATCH] Merge branch 'master' of http://bore.pub:10439/r/ERP_override
---
north-glass-erp/northglass-erp/src/lang/en.js | 2
north-glass-erp/northglass-erp/src/views/pp/processCard/SelectPrintFlowCard.vue | 3 +
north-glass-erp/northglass-erp/src/views/pp/workOrder/SelectWorkOrder.vue | 1
north-glass-erp/northglass-erp/src/views/pp/processCard/PrintFlowCard.vue | 51 +++++++++++++----
north-glass-erp/src/main/resources/mapper/pp/WordOrder.xml | 13 +++
north-glass-erp/src/main/resources/mapper/sd/OrderMapper.xml | 10 +++
north-glass-erp/src/main/java/com/example/erp/entity/sd/OrderGlassDetail.java | 5 -
north-glass-erp/src/main/java/com/example/erp/mapper/sd/OrderMapper.java | 2
north-glass-erp/northglass-erp/src/lang/zh.js | 2
north-glass-erp/northglass-erp/src/views/pp/processCard/SelectProcessCard.vue | 1
north-glass-erp/src/main/java/com/example/erp/service/sd/OrderService.java | 46 ++++++++++-----
north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml | 5 +
12 files changed, 107 insertions(+), 34 deletions(-)
diff --git a/north-glass-erp/northglass-erp/src/lang/en.js b/north-glass-erp/northglass-erp/src/lang/en.js
index b2fe3cf..2af3200 100644
--- a/north-glass-erp/northglass-erp/src/lang/en.js
+++ b/north-glass-erp/northglass-erp/src/lang/en.js
@@ -387,6 +387,8 @@
pleaseSelectCustomPrintLabelStyle:'Please select a custom print label style',
mergePrinting:'Merge printing',
printStatus:'Print status',
+ addAutomatically:'Auto fill',
+ selectFill:'Select fill'
},
reportingWorks:{
glassNumber:'number',
diff --git a/north-glass-erp/northglass-erp/src/lang/zh.js b/north-glass-erp/northglass-erp/src/lang/zh.js
index 0f8a98e..7cb9c1c 100644
--- a/north-glass-erp/northglass-erp/src/lang/zh.js
+++ b/north-glass-erp/northglass-erp/src/lang/zh.js
@@ -389,6 +389,8 @@
mergePrinting:'鍚堝苟鎵撳嵃',
printStatus:'鎵撳嵃鐘舵��',
labelPrinting2:'鏍囩鎵撳嵃2',
+ addAutomatically:'鑷姩濉厖',
+ selectFill:'閫変腑濉厖'
},
reportingWorks:{
glassNumber:'缂栧彿',
diff --git a/north-glass-erp/northglass-erp/src/views/pp/processCard/PrintFlowCard.vue b/north-glass-erp/northglass-erp/src/views/pp/processCard/PrintFlowCard.vue
index 06c0cf3..c767311 100644
--- a/north-glass-erp/northglass-erp/src/views/pp/processCard/PrintFlowCard.vue
+++ b/north-glass-erp/northglass-erp/src/views/pp/processCard/PrintFlowCard.vue
@@ -91,6 +91,7 @@
]
//鏍囩绫诲瀷
+let filteredOptions=[]
const lableType = ref('1')
const lableTypeOptions = [
{
@@ -110,6 +111,13 @@
label: `${company.printLabel.labelType3}`,
},
]
+let hidePrintLabels = company.printLabel.hideButton;
+
+if (hidePrintLabels=='true'){
+ filteredOptions = lableTypeOptions.filter((option, index) => index !== 2);
+}else {
+ filteredOptions = lableTypeOptions;
+}
//鍚堢墖娴佺▼鍗℃墦鍗颁笅鎷夐�夐」
const printMerge = ref('')
@@ -135,16 +143,17 @@
if (res.code == 200) {
produceList = produceList.value.concat(deepClone(res.data.data))
titleSelectJson.value.dataType = res.data.type
- // produceList.forEach(item => {
- // if(item.print_status == 1){
- // item.print_status='宸叉墦鍗�'
- // }
- // else if (item.print_status == 0){
- // item.print_status='鏈墦鍗�'
- // }
- // });
+ produceList.forEach(item => {
+ if(item.print_status == 1){
+ item.print_status='宸叉墦鍗�'
+ }
+ else if (item.print_status == 0){
+ item.print_status='鏈墦鍗�'
+ }
+ });
xGrid.value.reloadData(produceList)
gridOptions.loading = false
+ hideButton()
} else {
ElMessage.warning(res.msg)
}
@@ -276,13 +285,18 @@
return ''
})
]
- }
+ },
+
+
})
const gridEvents = {
toolbarButtonClick ({ code}) {
const $grid = xGrid.value
selectRecords = $grid.getCheckboxRecords()
+ selectRecords.forEach(obj => {
+ delete obj.print_status;
+ });
let type=printType.value
let faceOrientation=stateValue.value
let lableTypes=lableType.value
@@ -290,6 +304,7 @@
if ($grid) {
switch (code) {
case 'print': {
+ console.log(selectRecords)
if(selectRecords===null ||selectRecords===''||selectRecords.length===0){
ElMessage.warning(t('searchOrder.msgList.checkOrder'))
return
@@ -564,14 +579,14 @@
},
{
code: 'addAutomatically',
- name: "鑷姩濉厖",
+ name: t('processCard.addAutomatically'),
prefixIcon: 'vxe-icon-indicator',
visible: true,
disabled: false
},
{
code: 'selectFill',
- name: "閫変腑濉厖",
+ name: t('processCard.selectFill'),
prefixIcon: 'vxe-icon-indicator',
visible: true,
disabled: false
@@ -704,6 +719,18 @@
addListener(xGridDetail.value, detailGridOptions)
}
+const hideButton = () =>{
+ // 鏍规嵁鏉′欢鍊� hidePrintLabels 杩囨护鎸夐挳鏁扮粍
+ gridOptions.toolbarConfig.buttons = gridOptions.toolbarConfig.buttons.filter(button => {
+ // 杩欓噷鏍规嵁 hidePrintLabels 鐨勫�煎喅瀹氭槸鍚﹂殣钘� printLabel 鍜� printLabel2
+ if (hidePrintLabels=='true') {
+ return button.code !== 'printLabel' && button.code !== 'printLabel2';
+ } else {
+ return true; // 涓嶉殣钘忎换浣曟寜閽�
+ }
+ })
+}
+
</script>
<template>
@@ -722,7 +749,7 @@
<el-select v-model="lableType" class="m-2" :placeholder="lableTypeOptions[0].label" style="width: 140px">
<el-option
- v-for="item in lableTypeOptions"
+ v-for="item in filteredOptions"
:key="item.value"
:label="item.label"
:value="item.value"
diff --git a/north-glass-erp/northglass-erp/src/views/pp/processCard/SelectPrintFlowCard.vue b/north-glass-erp/northglass-erp/src/views/pp/processCard/SelectPrintFlowCard.vue
index e66d9f8..7d64f5f 100644
--- a/north-glass-erp/northglass-erp/src/views/pp/processCard/SelectPrintFlowCard.vue
+++ b/north-glass-erp/northglass-erp/src/views/pp/processCard/SelectPrintFlowCard.vue
@@ -161,6 +161,9 @@
slots: {filter: 'num1_filter'},
filterMethod: filterChanged
},
+ {field: 'customer_name', title: t('processCard.customerName'), filters: [{data: ''}], slots: {filter: 'num1_filter'},
+ filterMethod: filterChanged, width: 110},
+
{
field: 'project',
title: t('order.project'),
diff --git a/north-glass-erp/northglass-erp/src/views/pp/processCard/SelectProcessCard.vue b/north-glass-erp/northglass-erp/src/views/pp/processCard/SelectProcessCard.vue
index 6d4b920..d48537e 100644
--- a/north-glass-erp/northglass-erp/src/views/pp/processCard/SelectProcessCard.vue
+++ b/north-glass-erp/northglass-erp/src/views/pp/processCard/SelectProcessCard.vue
@@ -258,6 +258,7 @@
{title: t('basicData.operate'), width: 100, slots: {default: 'button_slot'}, fixed: "left"},
{type: 'seq', fixed: "left", title: t('basicData.Number'), width: 50},
{field: 'orderId', title: t('order.orderId'), filters: [{data: ''}], slots: {filter: 'num1_filter'}, width: 110},
+ {field: 'order.customerName', title: t('processCard.customerName'), filters: [{data: ''}], slots: {filter: 'num1_filter'}, width: 110},
{
field: 'processId',
width: 140,
diff --git a/north-glass-erp/northglass-erp/src/views/pp/workOrder/SelectWorkOrder.vue b/north-glass-erp/northglass-erp/src/views/pp/workOrder/SelectWorkOrder.vue
index 75a1a3b..3c1e5c7 100644
--- a/north-glass-erp/northglass-erp/src/views/pp/workOrder/SelectWorkOrder.vue
+++ b/north-glass-erp/northglass-erp/src/views/pp/workOrder/SelectWorkOrder.vue
@@ -244,6 +244,7 @@
{title: t('basicData.operate'), width: 110, slots: {default: 'button_slot'}, fixed: "left"},
{type: 'seq', fixed: "left", title: t('basicData.Number'), width: 50},
{field: 'orderId', title: t('order.orderId'), filters: [{data: ''}], slots: {filter: 'num1_filter'}, width: 110},
+ {field: 'order.customerName', title: t('processCard.customerName'), filters: [{data: ''}], slots: {filter: 'num1_filter'}, width: 110},
{
field: 'productionId',
title: t('workOrder.productionId'),
diff --git a/north-glass-erp/src/main/java/com/example/erp/entity/sd/OrderGlassDetail.java b/north-glass-erp/src/main/java/com/example/erp/entity/sd/OrderGlassDetail.java
index 0f49d25..91f192e 100644
--- a/north-glass-erp/src/main/java/com/example/erp/entity/sd/OrderGlassDetail.java
+++ b/north-glass-erp/src/main/java/com/example/erp/entity/sd/OrderGlassDetail.java
@@ -34,12 +34,9 @@
private Integer group;
private LocalDate productionTime;
private LocalDate createTime;
+
@TableField(select = false,exist = false)
private Order order;
- //@TableField(select = false)
-// @ManyToOne(fetch = FetchType.LAZY)
@TableField(select = false,exist = false)
private OrderDetail orderDetail;
-
-
}
diff --git a/north-glass-erp/src/main/java/com/example/erp/mapper/sd/OrderMapper.java b/north-glass-erp/src/main/java/com/example/erp/mapper/sd/OrderMapper.java
index 95184d0..71d1a39 100644
--- a/north-glass-erp/src/main/java/com/example/erp/mapper/sd/OrderMapper.java
+++ b/north-glass-erp/src/main/java/com/example/erp/mapper/sd/OrderMapper.java
@@ -28,4 +28,6 @@
Integer cancelOrder(String id);
List<Order> selectOrder(@Param("order") Order order);
+
+ Integer selectMaxOrderIdByMonth();
}
diff --git a/north-glass-erp/src/main/java/com/example/erp/service/sd/OrderService.java b/north-glass-erp/src/main/java/com/example/erp/service/sd/OrderService.java
index 9656fd4..34703da 100644
--- a/north-glass-erp/src/main/java/com/example/erp/service/sd/OrderService.java
+++ b/north-glass-erp/src/main/java/com/example/erp/service/sd/OrderService.java
@@ -118,23 +118,41 @@
}
//鐢熸垚璁㈠崟鏁版嵁
public void insertOrder(Order order,List<OrderDetail> OrderDetails,List<OrderOtherMoney> orderOtherMoneyList) {
- Integer maxOrderId = orderMapper.selectMaxOrderId();
- //鏌ヨ璁㈠崟id锛屽苟涓旇嚜澧�
- String formattedNumber = String.format("%02d", maxOrderId+1);
- //鏍煎紡鍖栧綋鍓嶆棩鏈�
- Date currentDate = new Date();
- SimpleDateFormat dateFormat = new SimpleDateFormat("yyMMdd");
- String formattedDate = dateFormat.format(currentDate);
- String orderId = "NG"+formattedDate+formattedNumber;
+
+ String orderId = getOrderId("day");
//寰�涓昏〃鎻掓暟鎹�
order.setOrderId(orderId);
order.setCreateOrder(2);
orderMapper.insert(order);
insertOtherDetail(orderId,OrderDetails,orderOtherMoneyList);
-
-
}
+
+ private String getOrderId(String dateType){
+ String orderId = null;
+ if(dateType.equals("day")){
+ Integer maxOrderId = orderMapper.selectMaxOrderId();
+ //鏌ヨ璁㈠崟id锛屽苟涓旇嚜澧�
+ String formattedNumber = String.format("%02d", maxOrderId+1);
+ //鏍煎紡鍖栧綋鍓嶆棩鏈�
+ Date currentDate = new Date();
+ SimpleDateFormat dateFormat = new SimpleDateFormat("yyMMdd");
+ String formattedDate = dateFormat.format(currentDate);
+ orderId = "NG"+formattedDate+formattedNumber;
+ }else if(dateType.equals("month")){
+ Integer maxOrderId = orderMapper.selectMaxOrderIdByMonth();
+ String formattedNumber = String.format("%04d", maxOrderId+1);
+ Date currentDate = new Date();
+ SimpleDateFormat dateFormat = new SimpleDateFormat("yyMM");
+ String formattedDate = dateFormat.format(currentDate);
+ orderId = "NG"+formattedDate+formattedNumber;
+
+ }
+
+ return orderId;
+ }
+
+
//淇敼璁㈠崟鏁版嵁锛屽苟涓旈噸鏂扮敓鎴愬涓壇琛ㄦ暟鎹�
public void updateOrder(Order order,List<OrderDetail> OrderDetails,List<OrderOtherMoney> orderOtherMoneyList) {
LambdaUpdateWrapper<Order> updateWrapper = new LambdaUpdateWrapper<>();
@@ -214,11 +232,7 @@
//淇敼璁㈠崟涓昏〃闈㈢Н涓庡懆闀夸互鍙婇噸閲�
orderMapper.updateOrderParameter(orderId);
- //鏌ヨ璁㈠崟灏忕墖琛ㄨ幏鍙栧伐鑹轰紶鍏ュ皬鐗囧伐鑹鸿〃
- //List<OrderGlassDetail> orderGlassDetails = orderGlassDetailMapper.selectOrderGlassDetail(orderId);
- /*List<OrderProcessDetail> orderProcessDetailList = getOrderProcessDetails(orderGlassDetails);
- //璧嬪�艰鍗曞伐鑹鸿〃
- orderProcessDetailMapper.insertOrderProcessDetail(orderProcessDetailList);*/
+
}
public static List<OrderProcessDetail> getOrderProcessDetails(List<OrderGlassDetail> orderGlassDetails) {
@@ -273,6 +287,8 @@
Order order = orderMapper.selectOne(new QueryWrapper<Order>().eq("order_id",id));
List<OrderDetail> orderDetails = orderDetailMapper.selectList(new QueryWrapper<OrderDetail>().eq("order_id",id));
List<OrderOtherMoney> orderOtherMoneyList = orderOtherMoneyMapper.findById(id);
+
+
Map<String,Object> map = new HashMap<>();
map.put("order",order);
map.put("orderDetails",orderDetails);
diff --git a/north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml b/north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml
index df699b9..e118810 100644
--- a/north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml
+++ b/north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml
@@ -63,6 +63,7 @@
sum(c.compute_gross_area) as compute_gross_area,
a.founder,
c.processing_note,
+ b.customer_name,
if(a.layout_status=0,'涓嶅彲鎺掔増',if(a.layout_status=1,'鍙帓鐗�','宸叉帓鐗�')) as layout_status
from (select id,order_id,process_id,order_number, quantity,founder,layout_status,create_time from flow_card
group by process_Id,order_number) as a left join sd.`order` as b on a.order_Id=b.order_id
@@ -93,7 +94,9 @@
<if test="flowCard.layoutStatus != null and flowCard.layoutStatus != '' and flowCard.layoutStatus == '宸叉帓鐗�'">
and a.layout_status regexp 2
</if>
-
+ <if test="flowCard.order.customerName != null and flowCard.order.customerName!= ''">
+ and b.customer_name regexp #{flowCard.order.customerName}
+ </if>
group by a.process_Id
ORDER BY a.id desc
limit #{offset},#{pageSize};
diff --git a/north-glass-erp/src/main/resources/mapper/pp/WordOrder.xml b/north-glass-erp/src/main/resources/mapper/pp/WordOrder.xml
index 1de3c6f..ec4be7e 100644
--- a/north-glass-erp/src/main/resources/mapper/pp/WordOrder.xml
+++ b/north-glass-erp/src/main/resources/mapper/pp/WordOrder.xml
@@ -15,6 +15,7 @@
<result column="project" property="order.project"/>
<result column="area" property="order.area"/>
<result column="creator" property="order.creator"/>
+ <result column="customer_name" property="order.customerName"/>
<!-- <association property="orderDetail" javaType="com.example.erp.entity.sd.OrderDetail">-->
<!-- <result column="product_id" property="productId"/>-->
<!-- <result column="product_name" property="productName"/>-->
@@ -37,7 +38,8 @@
o.order_type,
o.area as gross_area,
o.quantity as quantity,
- o.creator
+ o.creator,
+ o.customer_name
from sd.order_detail as od
left join `order` as o
on o.order_id=od.order_id
@@ -55,6 +57,9 @@
</if>
<if test="orderGlassDetail.order.orderType != null and orderGlassDetail.order.orderType!= ''">
and o.order_type regexp #{orderGlassDetail.order.orderType}
+ </if>
+ <if test="orderGlassDetail.order.customerName != null and orderGlassDetail.order.customerName!= ''">
+ and o.customer_name regexp #{orderGlassDetail.order.customerName}
</if>
<if test="orderGlassDetail.createTime != ''">
@@ -79,7 +84,8 @@
(od.gross_area) as gross_area,
(od.quantity) as quantity,
o.creator,
- od.id
+ od.id,
+ o.customer_name
from sd.order_glass_detail as ogd
left join order_detail as od
on od.order_id=ogd.order_id
@@ -103,6 +109,9 @@
<if test="orderGlassDetail.order.orderType != null and orderGlassDetail.order.orderType!= ''">
and o.order_type regexp #{orderGlassDetail.order.orderType}
</if>
+ <if test="orderGlassDetail.order.customerName != null and orderGlassDetail.order.customerName!= ''">
+ and o.customer_name regexp #{orderGlassDetail.order.customerName}
+ </if>
<if test="orderGlassDetail.createTime != ''">
and DATE_FORMAT((o.create_time),'%Y-%m-%d') BETWEEN #{ selectTime1 } AND #{ selectTime2 }
diff --git a/north-glass-erp/src/main/resources/mapper/sd/OrderMapper.xml b/north-glass-erp/src/main/resources/mapper/sd/OrderMapper.xml
index 4e31f15..0ed6c36 100644
--- a/north-glass-erp/src/main/resources/mapper/sd/OrderMapper.xml
+++ b/north-glass-erp/src/main/resources/mapper/sd/OrderMapper.xml
@@ -22,6 +22,16 @@
date(a.create_time) = curdate()
order by id desc,order_id desc limit 1
</select>
+
+ <select id="selectMaxOrderIdByMonth">
+ select
+ ifnull(SUBSTR(order_id from 7),0)
+ from
+ `order` as a
+ where
+ date(a.create_time) BETWEEN DATE_FORMAT(DATE(NOW()), '%Y-%m-01') AND DATE(NOW())
+ order by id desc limit 1
+ </select>
<update id="updateOrderParameter">
--
Gitblit v1.8.0