From 79b057e22e97e7db70faf25b33a5977b06771810 Mon Sep 17 00:00:00 2001
From: 廖井涛 <2265517004@qq.com>
Date: 星期一, 08 十二月 2025 14:52:54 +0800
Subject: [PATCH] 打印加工单修改,新增用户登录日志
---
north-glass-erp/northglass-erp/src/router/index.js | 17 +
north-glass-erp/northglass-erp/src/lang/en.js | 3
north-glass-erp/northglass-erp/src/views/system/userLog/UserListLog.vue | 235 +++++++++++++++++++++++
north-glass-erp/src/main/resources/mapper/sd/DeliveryDetailMapper.xml | 1
north-glass-erp/src/main/java/com/example/erp/mapper/userInfo/UserMapper.java | 3
north-glass-erp/northglass-erp/src/views/system/userLog/UserLog.vue | 61 ++++++
north-glass-erp/northglass-erp/src/views/sd/delivery/CreateDelivery.vue | 118 +++++++++++
north-glass-erp/northglass-erp/src/lang/zh.js | 3
north-glass-erp/src/main/resources/mapper/userInfo/User.xml | 5
north-glass-erp/src/main/java/com/example/erp/controller/userInfo/UserController.java | 6
north-glass-erp/northglass-erp/src/lang/ar.js | 3
north-glass-erp/northglass-erp/src/lang/ru.js | 3
north-glass-erp/northglass-erp/src/views/sd/delivery/SelectOrderList.vue | 103 ++++++++-
north-glass-erp/northglass-erp/src/components/sd/order/PrintSheet4.vue | 4
north-glass-erp/src/main/java/com/example/erp/entity/sd/Order.java | 3
north-glass-erp/northglass-erp/src/lang/kr.js | 3
north-glass-erp/src/main/java/com/example/erp/service/userInfo/UserService.java | 18 +
17 files changed, 565 insertions(+), 24 deletions(-)
diff --git a/north-glass-erp/northglass-erp/src/components/sd/order/PrintSheet4.vue b/north-glass-erp/northglass-erp/src/components/sd/order/PrintSheet4.vue
index d0386ff..6100c64 100644
--- a/north-glass-erp/northglass-erp/src/components/sd/order/PrintSheet4.vue
+++ b/north-glass-erp/northglass-erp/src/components/sd/order/PrintSheet4.vue
@@ -156,9 +156,9 @@
</tr>
<tr class="title-s">
- <th colspan="2" style="width: 30%;text-align: left;"><span>{{data.order.orderType}} 鎬婚噸閲�:{{ grossNum.weight }}</span></th>
+ <th colspan="2" style="width: 30%;text-align: left;"><span>鎬婚噸閲�:{{ grossNum.weight }}</span></th>
<th colspan="5" style="width: 40%;">
- <h3 >鐢熶骇浠诲姟鍗�(鎴愬搧)</h3>
+ <h3 >鐢熶骇浠诲姟鍗�({{data.order.orderType}})</h3>
</th>
<th colspan="2" style="width: 30%;">璁㈠崟缂栧彿锛�<span>{{ data.order.orderId }}</span>
<span v-if="company.companyName==='甯稿窞甯傚悏鍒╃幓鐠冩湁闄愬叕鍙�'&& data.order.batch!==''">(鍘焮{ data.order.batch }})</span>
diff --git a/north-glass-erp/northglass-erp/src/lang/ar.js b/north-glass-erp/northglass-erp/src/lang/ar.js
index 4b0bb9d..9fec150 100644
--- a/north-glass-erp/northglass-erp/src/lang/ar.js
+++ b/north-glass-erp/northglass-erp/src/lang/ar.js
@@ -1333,7 +1333,8 @@
userPassWord :'鬲睾賷賷乇 賰賱賲丞 丕賱賲乇賵乇',
glassPrice:'鐜荤拑浠锋牸',
glassOptimize:'鐜荤拑浼樺寲',
- finishedGlassShelf:'鎴愬搧鏂欐灦'
+ finishedGlassShelf:'鎴愬搧鏂欐灦',
+ userLog:'鐧诲綍鏃ュ織'
},
glassPrice:{
diff --git a/north-glass-erp/northglass-erp/src/lang/en.js b/north-glass-erp/northglass-erp/src/lang/en.js
index ebadad0..29f9e6e 100644
--- a/north-glass-erp/northglass-erp/src/lang/en.js
+++ b/north-glass-erp/northglass-erp/src/lang/en.js
@@ -1333,7 +1333,8 @@
userPassWord :'User Pass Word',
glassPrice:'Glass Price',
glassOptimize:'鐜荤拑浼樺寲',
- finishedGlassShelf:'鎴愬搧鏂欐灦'
+ finishedGlassShelf:'鎴愬搧鏂欐灦',
+ userLog:'鐧诲綍鏃ュ織'
},
glassPrice:{
diff --git a/north-glass-erp/northglass-erp/src/lang/kr.js b/north-glass-erp/northglass-erp/src/lang/kr.js
index 0ed24cd..c808376 100644
--- a/north-glass-erp/northglass-erp/src/lang/kr.js
+++ b/north-glass-erp/northglass-erp/src/lang/kr.js
@@ -1334,7 +1334,8 @@
userPassWord :'牍勲皜氩堩樃 氤�瓴�',
glassPrice:'鞙犽Μ 臧�瓴�',
glassOptimize:'鞙犽Μ 斓滌爜頇�',
- finishedGlassShelf:'鎴愬搧鏂欐灦'
+ finishedGlassShelf:'鎴愬搧鏂欐灦',
+ userLog:'鐧诲綍鏃ュ織'
},
glassPrice:{
diff --git a/north-glass-erp/northglass-erp/src/lang/ru.js b/north-glass-erp/northglass-erp/src/lang/ru.js
index 94afeba..0acd315 100644
--- a/north-glass-erp/northglass-erp/src/lang/ru.js
+++ b/north-glass-erp/northglass-erp/src/lang/ru.js
@@ -1334,7 +1334,8 @@
userPassWord :'袠蟹屑械薪懈褌褜 锌邪褉芯谢褜',
glassPrice:'笑械薪邪 褋褌械泻谢邪.',
glassOptimize:'鐜荤拑浼樺寲',
- finishedGlassShelf:'鎴愬搧鏂欐灦'
+ finishedGlassShelf:'鎴愬搧鏂欐灦',
+ userLog:'鐧诲綍鏃ュ織'
},
glassPrice:{
diff --git a/north-glass-erp/northglass-erp/src/lang/zh.js b/north-glass-erp/northglass-erp/src/lang/zh.js
index 6ea842b..06112dd 100644
--- a/north-glass-erp/northglass-erp/src/lang/zh.js
+++ b/north-glass-erp/northglass-erp/src/lang/zh.js
@@ -1335,7 +1335,8 @@
userPassWord :'淇敼瀵嗙爜',
glassPrice:'鐜荤拑浠锋牸',
glassOptimize:'鐜荤拑浼樺寲',
- finishedGlassShelf:'鎴愬搧鏂欐灦'
+ finishedGlassShelf:'鎴愬搧鏂欐灦',
+ userLog:'鐧诲綍鏃ュ織'
},
glassPrice:{
diff --git a/north-glass-erp/northglass-erp/src/router/index.js b/north-glass-erp/northglass-erp/src/router/index.js
index a13144c..4ba8821 100644
--- a/north-glass-erp/northglass-erp/src/router/index.js
+++ b/north-glass-erp/northglass-erp/src/router/index.js
@@ -83,6 +83,23 @@
}
]
},
+ {
+ path:'userLog',
+ name: 'userLog',
+ component: () => import('../views/system/userLog/UserLog.vue'),
+ children:[
+ {
+ path: 'userListLog',
+ name: 'userListLog',
+ component: () => import('../views/system/userLog/UserListLog.vue'),
+ },
+ {
+ name:'userLog',
+ path: '',
+ redirect:'/main/userLog/userListLog'
+ }
+ ]
+ },
{
path:'glassPrice',
diff --git a/north-glass-erp/northglass-erp/src/views/sd/delivery/CreateDelivery.vue b/north-glass-erp/northglass-erp/src/views/sd/delivery/CreateDelivery.vue
index 10c0027..ffbf370 100644
--- a/north-glass-erp/northglass-erp/src/views/sd/delivery/CreateDelivery.vue
+++ b/north-glass-erp/northglass-erp/src/views/sd/delivery/CreateDelivery.vue
@@ -19,6 +19,8 @@
import {multiply} from "@/utils/decimal";
import MaterialAddition from "@/views/mm/ingredientStock/MaterialAddition.vue";
import {copyTableCellValue} from "@/hook/copyTableCellValue";
+import SelectOrderList from "@/views/sd/delivery/SelectOrderList.vue";
+import { ElDialog } from "element-plus";
//璇█鑾峰彇
const { t } = useI18n()
@@ -35,6 +37,19 @@
let otherMoneyVisible = ref(false)
let otherMoney = ref(null)
+const dialogSelectOrderVisible = ref(false); // 鎺у埗寮圭獥鏄剧ず
+const currentOrderIds = ref([]); // 宸叉湁鐨勮鍗旾D锛岀敤浜庢帓闄�
+
+
+// 鍒濆鍖栧凡閫夎鍗旾D锛堝湪onMounted涓皟鐢級
+const initCurrentOrderIds = () => {
+ if (produceList && produceList.length > 0) {
+ const orderIds = produceList.map(item => item.orderId);
+ currentOrderIds.value = [...new Set(orderIds)];
+ }else {
+ currentOrderIds.value = [];
+ }
+};
const hasDecimal=(value)=>{
const regex=/\./ // 瀹氫箟姝e垯琛ㄨ揪寮忥紝鏌ユ壘灏忔暟鐐�
@@ -209,6 +224,7 @@
//绂佺敤鎸夐挳
gridOptions.toolbarConfig.buttons[2].disabled = true
gridOptions.toolbarConfig.buttons[3].disabled = true
+ //gridOptions.toolbarConfig.buttons[4].disabled = false
//鏄剧ず澶嶉�夋
xGrid.value.showColumn("select")
gridOptions.loading=false
@@ -245,6 +261,7 @@
if(titleUploadData.value.deliveryState!==0){
gridOptions.toolbarConfig.buttons[2].disabled = true
gridOptions.toolbarConfig.buttons[1].disabled = true
+ //gridOptions.toolbarConfig.buttons[4].disabled = true
}
if(titleUploadData.value.deliveryState===0){
gridOptions.toolbarConfig.buttons[3].disabled = true
@@ -370,6 +387,7 @@
{'code': 'addToExamine', 'name': t('reportingWorks.saveAndReview'),status: 'primary',icon: 'vxe-icon-save'},
{'code': 'toExamine', 'name': t('basicData.review'),status: 'primary'},
{'code': 'CounterExamination', 'name': t('basicData.cancelReview'),status: 'primary'},
+ //{'code': 'addOtherOrders','name': t('璁㈠崟娣诲姞'),'status': 'primary'}
//{'code': 'glassShelf', 'name': t('finishedGlassShelf.finishedGlassShelfEmit'),status: 'primary'}
],
/*import: false,
@@ -616,6 +634,13 @@
})
break
}
+ case 'addOtherOrders': {
+ // 鏄剧ず寮圭獥鍓嶆洿鏂板凡閫夎鍗旾D
+ initCurrentOrderIds();
+ // 鏄剧ず寮圭獥
+ dialogSelectOrderVisible.value = true;
+ break;
+ }
}
}
},
@@ -826,7 +851,83 @@
};
+// 澶勭悊浠嶴electOrderList閫変腑鐨勮鍗�
+const handleSelectedOrders = async (selectedOrders) => {
+ if (!selectedOrders || selectedOrders.length === 0) return;
+ // 鍏抽棴寮圭獥
+ dialogSelectOrderVisible.value = false;
+
+ // 楠岃瘉閫変腑鐨勮鍗曟槸鍚︾鍚堟潯浠�
+ const { customerId, project } = titleUploadData.value;
+ const invalidOrders = selectedOrders.filter(order =>
+ order.customerId !== parseInt(customerId) || order.project !== project
+ );
+
+ if (invalidOrders.length > 0) {
+ ElMessage.warning(t('delivery.onlySameCustomerProject'));
+ return;
+ }
+
+ try {
+ // 鏄剧ず鍔犺浇鐘舵��
+ gridOptions.loading = true;
+
+ // 鎵归噺鏌ヨ璁㈠崟鏄庣粏锛堟寜璁㈠崟ID锛�
+ const orderIds = selectedOrders.map(order => order.orderId).join('|');
+ filterData.value.orderId=orderIds
+ request.post("/delivery/getSelectShippingOrderDetails/1/100",filterData.value).then((res) => {
+ if (res.code == 200) {
+ // 澶勭悊杩斿洖鐨勬槑缁嗘暟鎹�
+ const orderDetails = res.data.data || [];
+ //鍚堝苟鏁版嵁
+ mergeData(orderDetails);
+ } else {
+ ElMessage.warning(res.msg || t('basicData.msg.data鑾峰彇澶辫触'));
+ }
+ })
+ } catch (error) {
+ ElMessage.error(t('basicData.msg.ServerConnectionError'));
+ console.error('鏌ヨ璁㈠崟鏄庣粏澶辫触:', error);
+ } finally {
+ // 鍏抽棴鍔犺浇鐘舵��
+ gridOptions.loading = false;
+ }
+};
+
+// 鍚堝苟鏁版嵁锛氬垽鏂璷rderId銆乷rderNumber銆乥oxNo鏄惁鐩稿悓锛岀浉鍚屽垯绱姞鏁伴噺锛屼笉鍚屽垯鏂板
+const mergeData = (newDataList) => {
+ // 澶嶅埗鐜版湁鏁版嵁锛堥伩鍏嶇洿鎺ヤ慨鏀瑰搷搴斿紡婧愭暟鎹級
+ const currentList = [...produceList];
+
+ newDataList.forEach(newItem => {
+ // 鎻愬彇鏂版暟鎹殑鍏抽敭姣斿瀛楁
+ const newOrderId = newItem.orderId;
+ const newOrderNumber = newItem.orderNumber;
+ const newBoxNo = newItem.finishedGoodsInventory?.boxNo || ''; // 澶勭悊鍙兘鐨剈ndefined
+
+ // 鍦ㄧ幇鏈夋暟鎹腑鏌ユ壘鍖归厤椤癸紙涓変釜瀛楁瀹屽叏鐩稿悓锛�
+ const matchedItem = currentList.find(item =>
+ item.orderId === newOrderId &&
+ item.orderNumber === newOrderNumber &&
+ (item.finishedGoodsInventory?.boxNo || '') === newBoxNo
+ );
+
+ if (matchedItem) {
+ // 鎵惧埌鍖归厤椤癸細绱姞鏁伴噺锛堢‘淇濇槸鏁板�肩被鍨嬶級
+ matchedItem.deliveryDetail.quantity = (Number(matchedItem.deliveryDetail.quantity) || 0) +
+ (Number(newItem.deliveryDetail.quantity) || 0);
+ } else {
+ // 鏈壘鍒板尮閰嶉」锛氭柊澧炰竴鏉℃暟鎹�
+ currentList.push(newItem);
+ }
+ });
+
+ // 鏇存柊鍝嶅簲寮忔暟鎹�
+ produceList = currentList;
+ // 鍒锋柊琛ㄦ牸
+ xGrid.value.reloadData(produceList);
+};
</script>
@@ -997,6 +1098,23 @@
@handle-result="handleChildResult2"
/>
</el-dialog>
+
+ <el-dialog
+ v-model="dialogSelectOrderVisible"
+ :title="t('璁㈠崟娣诲姞')"
+ style="width: 70%;height:75% "
+ destroy-on-close
+ :close-on-click-modal="false"
+ :close-on-press-escape="false">
+ >
+ <SelectOrderList
+ style="width: 100%;height: 600px"
+ :customer-id="titleUploadData.customerId"
+ :project="titleUploadData.project"
+ :exclude-order-ids="currentOrderIds"
+ @select-orders="handleSelectedOrders"
+ />
+ </el-dialog>
</div>
</template>
diff --git a/north-glass-erp/northglass-erp/src/views/sd/delivery/SelectOrderList.vue b/north-glass-erp/northglass-erp/src/views/sd/delivery/SelectOrderList.vue
index f4356c9..63afece 100644
--- a/north-glass-erp/northglass-erp/src/views/sd/delivery/SelectOrderList.vue
+++ b/north-glass-erp/northglass-erp/src/views/sd/delivery/SelectOrderList.vue
@@ -1,7 +1,7 @@
<script setup>
import {Search} from "@element-plus/icons-vue"
import {useRouter} from "vue-router"
-import {reactive, ref} from "vue";
+import {onMounted, reactive, ref} from "vue";
import request from "@/utils/request"
import deepClone from "@/utils/deepClone"
import VXETable from "vxe-table";
@@ -18,6 +18,15 @@
const username = userStore.user.userName
const userid = userStore.user.userId
let produceList = ref([])
+
+
+const props = defineProps({
+ customerId: null,
+ project: null,
+ excludeOrderIds: null
+})
+
+const emit = defineEmits(['selectOrders'])
const getTableRow = (row,type) =>{
switch (type) {
@@ -56,6 +65,9 @@
quantityAvailable:'',
},
+ customerId: null, // 鏂板
+ project: null, // 鏂板
+ excludeOrderIds: [] // 鏂板
})
let selectDate = ref(["",""])
@@ -68,23 +80,38 @@
})
-//绗竴娆¤皟鐢�
-request.post(`/delivery/getSelectOrderInventory/1/${total.pageSize}/${orderInfo.selectOrderListDate}`,filterData.value).then((res) => {
- if(res.code==200){
- total.dataTotal = res.data.total.total*1
- total.pageTotal= res.data.total.pageTotal
- orderInfo.selectOrderListDate = res.data.selectDate
- pageNum.value=1
- produceList = deepClone(res.data.data)
- xGrid.value.loadData(produceList)
- gridOptions.loading=false
+// 绗竴娆¤皟鐢紝淇敼涓哄甫绛涢�夋潯浠�
+const fetchOrders = () => {
+ // 鏂板锛氫粠props鑾峰彇绛涢�夋潯浠�
+ if(props.customerId!==undefined){
+ filterData.value.customerId = props.customerId
+ filterData.value.project = props.project
+ filterData.value.excludeOrderIds = props.excludeOrderIds
+ gridOptions.toolbarConfig.buttons[0].visible = false
}else{
- ElMessage.warning(res.msg)
- router.push("/login")
+ gridOptions.toolbarConfig.buttons[1].visible = false
}
-})
+ request.post(`/delivery/getSelectOrderInventory/${pageNum.value}/${total.pageSize}/${orderInfo.selectOrderListDate}`, filterData.value).then((res) => {
+ if(res.code==200){
+ total.dataTotal = res.data.total.total*1
+ total.pageTotal= res.data.total.pageTotal
+ orderInfo.selectOrderListDate = res.data.selectDate
+ produceList = deepClone(res.data.data)
+ xGrid.value.loadData(produceList)
+ gridOptions.loading=false
+ }else{
+ ElMessage.warning(res.msg)
+ router.push("/login")
+ }
+ })
+}
+
+
+onMounted(() => {
+ fetchOrders()
+})
const changeFilterEvent = (event, option, $panel,) => {
// 鎵嬪姩瑙﹀彂绛涢��
@@ -104,6 +131,16 @@
}else{
filterData.value[column.property] = value
}
+
+ if(props.customerId!==undefined){
+ filterData.value.customerId = props.customerId
+ filterData.value.project = props.project
+ filterData.value.excludeOrderIds = props.excludeOrderIds
+ gridOptions.toolbarConfig.buttons[0].visible = false
+ }else{
+ gridOptions.toolbarConfig.buttons[1].visible = false
+ }
+
request.post(`/delivery/getSelectOrderInventory/1/${total.pageSize}/${orderInfo.selectOrderListDate}`,filterData.value).then((res) => {
if(res.code==200){
@@ -142,7 +179,7 @@
const changeDate = ()=>{
pageNum.value=1
- selectOrderList()
+ fetchOrders()
}
//椤佃剼璺宠浆
@@ -150,7 +187,7 @@
total.pageTotal = pageSize
pageNum.value=currentPage
- selectOrderList()
+ fetchOrders()
}
@@ -215,7 +252,8 @@
],//琛ㄥご鎸夐挳
toolbarConfig: {
buttons: [
- {'code': 'add', 'name': t('delivery.delivery'),status: 'primary',icon: 'vxe-icon-add'}
+ {'code': 'add', 'name': t('delivery.delivery'),status: 'primary',icon: 'vxe-icon-add'},
+ {'code': 'update', 'name': t('delivery.delivery'),status: 'primary',icon: 'vxe-icon-add'}
],
/*import: false,
export: true,
@@ -282,6 +320,37 @@
router.push({path: '/main/delivery/createDelivery', query: { orderId: order_id }})
break
}
+ case 'update': {
+ const selectRecords = $grid.getCheckboxRecords()
+ if (selectRecords.length === 0) {
+ ElMessage.warning(t('productStock.unselectedData'))
+ return
+ }
+
+ // 楠岃瘉鎵�閫夎鍗曟槸鍚︾鍚堟潯浠讹紙铏界劧宸茬瓫閫夛紝浣嗕簩娆¢獙璇佹洿瀹夊叏锛�
+ const customerIdArray = selectRecords.map(item => item.customerId)
+ const projectArray = selectRecords.map(item => item.project?.trim() || '')
+
+ if(!isAllEqual(customerIdArray)){
+ ElMessage.warning(t('delivery.pleaseSelectTheSameCustomerOrder'))
+ return
+ }
+ if(!isAllEqual(projectArray)){
+ ElMessage.warning(t('delivery.pleaseSelectTheSameCustomerProject'))
+ return
+ }
+
+ const simpleOrders = selectRecords.map(order => ({
+ orderId: order.orderId,
+ customerId: order.customerId,
+ project: order.project,
+ // 鍙ˉ鍏呭叾浠栭渶瑕佺殑涓昏鍗曞瓧娈�
+ }));
+
+ // 閫氳繃浜嬩欢杩斿洖缁欑埗缁勪欢
+ emit('select-orders', simpleOrders);
+ break
+ }
}
}
}
diff --git a/north-glass-erp/northglass-erp/src/views/system/userLog/UserListLog.vue b/north-glass-erp/northglass-erp/src/views/system/userLog/UserListLog.vue
new file mode 100644
index 0000000..eb3180c
--- /dev/null
+++ b/north-glass-erp/northglass-erp/src/views/system/userLog/UserListLog.vue
@@ -0,0 +1,235 @@
+<script setup>
+import {onBeforeMount, onMounted, reactive, ref} from "vue"
+import {changeFilterEvent,filterChanged} from "@/hook"
+import request from "@/utils/request"
+import {useRouter,useRoute} from "vue-router"
+import {useI18n} from "vue-i18n"
+import {ElMessage, ElMessageBox} from "element-plus"
+import deepClone from "@/utils/deepClone";
+const { t } = useI18n()
+const router = useRouter()
+const route = useRoute()
+const dialogVisible = ref(false)
+const dialogVisibleProcess = ref(false)
+let roleList = ref([])
+//宸ュ簭
+const processValue = ref()
+let userRole= ref({
+ userId:'',
+ roles:[]
+})
+let processRow = ref({
+ process: null,
+ userId:null
+})
+let produceList = ref([])
+const xGrid = ref()
+const gridOptions = reactive({
+ border: "full",//琛ㄦ牸鍔犺竟妗�
+ keepSource: true,//淇濇寔婧愭暟鎹�
+ align: 'center',//鏂囧瓧灞呬腑
+ stripe:true,//鏂戦┈绾�
+ rowConfig: {isCurrent: true, isHover: true,height: 30},//榧犳爣绉诲姩鎴栭�夋嫨楂樹寒
+ id: 'userList',
+ showFooter: false,//鏄剧ず鑴�
+ printConfig: {},
+ importConfig: {},
+ exportConfig: {},
+ scrollY:{ enabled: true },//寮�鍚櫄鎷熸粴鍔�
+ showOverflow:true,
+ columnConfig: {
+ resizable: true,
+ useKey: true
+ },
+ filterConfig: { //绛涢�夐厤缃」
+ },
+ customConfig: {
+ storage: true
+ },
+ editConfig: {
+ trigger: 'click',
+ mode: 'row',
+ showStatus: true
+ },
+
+ //琛ㄥご鍙傛暟
+ columns:[
+ {type: 'seq', title: t('basicData.Number'), width: 80 ,fixed:"left"},
+ {field: 'operator_id',width:120, title: t('鐧诲綍鍚�'), sortable: true, filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged},
+ {field: 'operator',width:120, title: t('鐢ㄦ埛鍚�'), sortable: true, filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged},
+ {field: 'format_create_time',width:160, title: t('鐧诲綍鏃堕棿'),sortable: true},
+ ],
+
+ //琛ㄥご鎸夐挳
+ toolbarConfig: {
+ buttons: [
+
+ ],
+ zoom: true,
+ custom: true
+ },
+})
+
+onMounted(()=>{
+ request.post('/user/getUserLog').then(res=>{
+ if(res.code==200){
+ produceList = deepClone(res.data.data)
+ xGrid.value.loadData(produceList)
+ gridOptions.loading=false
+ }else{
+ ElMessage.warning(res.msg)
+ router.push("/login")
+ }
+ })
+
+})
+
+const getTableRow = (row,type) => {
+ switch (type) {
+ case 'edit': {
+ userRole.value.roles = []
+ dialogVisible.value = true
+ row.userRoleList.forEach(item=>{
+ userRole.value.roles.push(item.roleId)
+ })
+ userRole.value.userId = row.id
+ break
+ }
+ case 'delete': {
+ request.post(`/userInfo/userDelete/${row.id}`).then((res) => {
+ if(res.code==200 && res.data ===true){
+ ElMessage.success(t('searchOrder.msgDeleteSuccess'))
+ router.push({path:'/main/user/userList',query:{random:Math.random()}})
+ }else{
+ ElMessage.warning(t('searchOrder.msgDeleteFail'))
+ }
+ })
+ break
+ }
+ case 'editProcess': {
+ dialogVisibleProcess.value = true
+ processRow.value.userId = row.id
+ break
+ }
+
+ }
+}
+
+const handleClose = (done) => {
+ userRole.value.roles = []
+ done()
+}
+
+
+
+
+
+
+
+
+
+</script>
+
+<template>
+ <div style="width: 100%;height: 100%">
+ <div class="main-table">
+ <vxe-grid
+ height="100%"
+ class="mytable-scrollbar"
+ ref="xGrid"
+ v-bind="gridOptions"
+ >
+ <template #filter="{ column, $panel }">
+ <div>
+ <div v-for="(option, index) in column.filters" :key="index">
+ <input
+ type="type"
+ v-model="option.data"
+ @keyup.enter.native="$panel.confirmFilter()"
+ @input="changeFilterEvent($event, option, $panel)"/>
+ </div>
+ </div>
+ </template>
+
+ <template #button_slot="{ row }">
+ <el-button @click="getTableRow(row,'edit')" link type="primary" size="small">{{ $t('user.setUpRoles') }}</el-button>
+ <el-button @click="getTableRow(row,'editProcess')" link type="primary" size="small">{{ $t('user.setProcess') }}</el-button>
+ <el-popconfirm @confirm="getTableRow(row,'delete')" :title="$t('searchOrder.deleteConfirm')">
+ <template #reference>
+ <el-button link type="primary" size="small">{{ $t('basicData.delete') }}</el-button>
+ </template>
+ </el-popconfirm>
+ </template>
+
+ <template #num1_filter="{ column, $panel }">
+ <div>
+ <div v-for="(option, index) in column.filters" :key="index">
+ <input type="type" v-model="option.data" @keyup.enter.native="$panel.confirmFilter()" @input="changeFilterEvent($event, option, $panel)"/>
+ </div>
+ </div>
+ </template>
+ </vxe-grid>
+ </div>
+
+ <el-dialog
+ v-model="dialogVisible"
+ :title="$t('user.roleSelection')"
+ width="30%"
+ :before-close="handleClose"
+ >
+ <span>
+ <el-radio v-for="(item) in roleList"
+ :label="item.id"
+ v-model="userRole.roles" >
+ {{item.role}}
+ </el-radio>
+ </span>
+ <template #footer>
+ <span class="dialog-footer">
+ <el-button @click="dialogVisible = false">{{ $t('basicData.cancelButtonText') }}</el-button>
+ <el-button type="primary" @click="roleUpdate">
+ {{ $t('basicData.confirmButtonText') }}
+ </el-button>
+ </span>
+ </template>
+ </el-dialog>
+ <el-dialog
+ v-model="dialogVisibleProcess"
+ :title="$t('user.roleSelection')"
+ width="30%"
+ :before-close="handleClose"
+ >
+ <el-select v-model="processValue" clearable :placeholder="$t('reportingWorks.selectProcess')" default-value="default_city" style="width: 120px">
+ <el-option
+ v-for="item in processRow['process']"
+ :key="item.id"
+ :label="item.basic_name"
+ :value="item.basic_name"
+ />
+ </el-select>
+ <template #footer>
+ <span class="dialog-footer">
+ <el-button @click="dialogVisibleProcess = false">{{ $t('basicData.cancelButtonText') }}</el-button>
+ <el-button type="primary" @click="updateProcess">
+ {{ $t('basicData.confirmButtonText') }}
+ </el-button>
+ </span>
+ </template>
+ </el-dialog>
+ </div>
+</template>
+
+<style scoped>
+.dialog-footer button:first-child {
+ margin-right: 10px;
+}
+.head{
+ width: 100%;
+ height: 35px;
+}
+
+.main-table{
+ width: 100%;
+ height: calc(100% - 0px);
+}
+</style>
\ No newline at end of file
diff --git a/north-glass-erp/northglass-erp/src/views/system/userLog/UserLog.vue b/north-glass-erp/northglass-erp/src/views/system/userLog/UserLog.vue
new file mode 100644
index 0000000..55f1e9d
--- /dev/null
+++ b/north-glass-erp/northglass-erp/src/views/system/userLog/UserLog.vue
@@ -0,0 +1,61 @@
+<script setup>
+import {ArrowLeftBold, ArrowRight, Search} from "@element-plus/icons-vue"
+import {useRouter,useRoute,onBeforeRouteUpdate} from "vue-router"
+import {useI18n} from "vue-i18n"
+const { t } = useI18n()
+const router = useRouter()
+const route = useRoute()
+let indexFlag=$ref(1)
+function changeRouter(index){
+ indexFlag=index
+}
+
+
+
+
+</script>
+
+<template>
+ <div id="main-div">
+ <div id="div-title">
+ <el-breadcrumb :separator-icon="ArrowRight">
+ <el-breadcrumb-item @click="changeRouter(1)" :class="indexFlag===1?'indexTag':''" :to="{ path: '/main/userLog/userListLog' }">{{$t('鏃ュ織棣栭〉')}}</el-breadcrumb-item>
+ <el-breadcrumb-item v-show="false" />
+ </el-breadcrumb>
+ </div>
+
+ <div id="main-body">
+ <router-view :key="route.fullPath" />
+ </div>
+ </div>
+</template>
+
+<style scoped>
+#main-div{
+ width: 99%;
+ height: 100%;
+}
+#div-title{
+ height: 2%;
+ width: 100%;
+}
+#searchButton{
+ margin-top: -5px;
+ margin-left: 1rem;
+}
+#searchButton1{
+//margin-left: 10rem;
+}
+/*main-body鏍峰紡*/
+#main-body{
+ width: 100%;
+ height: 95%;
+ margin-top: 1%;
+}
+#select{
+ margin-left:0.5rem;
+}
+:deep(.indexTag .el-breadcrumb__inner){
+ color: #5CADFE !important;
+}
+</style>
\ No newline at end of file
diff --git a/north-glass-erp/src/main/java/com/example/erp/controller/userInfo/UserController.java b/north-glass-erp/src/main/java/com/example/erp/controller/userInfo/UserController.java
index 2f57860..5269f53 100644
--- a/north-glass-erp/src/main/java/com/example/erp/controller/userInfo/UserController.java
+++ b/north-glass-erp/src/main/java/com/example/erp/controller/userInfo/UserController.java
@@ -68,4 +68,10 @@
return Result.success( userService.updateUserName(object));
}
+ @ApiOperation("鐢ㄦ埛鐧诲綍璁板綍")
+ @PostMapping("/getUserLog")
+ public Result getUserLog(){
+ return Result.success( userService.getUserLog());
+ }
+
}
diff --git a/north-glass-erp/src/main/java/com/example/erp/entity/sd/Order.java b/north-glass-erp/src/main/java/com/example/erp/entity/sd/Order.java
index da7be5d..abf8760 100644
--- a/north-glass-erp/src/main/java/com/example/erp/entity/sd/Order.java
+++ b/north-glass-erp/src/main/java/com/example/erp/entity/sd/Order.java
@@ -9,6 +9,7 @@
import lombok.Data;
import java.time.LocalDate;
+import java.util.List;
@Data
@TableName("sd.`order`")
@@ -105,6 +106,8 @@
private Integer goodsQuantity;
@TableField(select = false,exist = false)
private String timeOut;
+ @TableField(select = false,exist = false)
+ private List<String> excludeOrderIds;
@TableField(value = "customer_id")
private Customer customer;
diff --git a/north-glass-erp/src/main/java/com/example/erp/mapper/userInfo/UserMapper.java b/north-glass-erp/src/main/java/com/example/erp/mapper/userInfo/UserMapper.java
index ac9a6a0..fc5fc75 100644
--- a/north-glass-erp/src/main/java/com/example/erp/mapper/userInfo/UserMapper.java
+++ b/north-glass-erp/src/main/java/com/example/erp/mapper/userInfo/UserMapper.java
@@ -8,6 +8,7 @@
import org.apache.ibatis.annotations.Select;
import java.util.List;
+import java.util.Map;
@Mapper
@@ -41,4 +42,6 @@
List<User> findByAddress(String userName);
String selectOptimizeParmsById(@Param("username") String username);
+
+ List<Map<String, Object>> getUserLog();
}
diff --git a/north-glass-erp/src/main/java/com/example/erp/service/userInfo/UserService.java b/north-glass-erp/src/main/java/com/example/erp/service/userInfo/UserService.java
index 3b0510c..64ca017 100644
--- a/north-glass-erp/src/main/java/com/example/erp/service/userInfo/UserService.java
+++ b/north-glass-erp/src/main/java/com/example/erp/service/userInfo/UserService.java
@@ -5,11 +5,13 @@
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.erp.controller.dto.UserDTO;
+import com.example.erp.entity.userInfo.Log;
import com.example.erp.entity.userInfo.Role;
import com.example.erp.entity.userInfo.User;
import com.example.erp.mapper.pp.ProductionSchedulingMapper;
import com.example.erp.mapper.userInfo.*;
import com.example.erp.tools.TokenTools;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
@@ -27,6 +29,9 @@
private final PermissionRoleMapper permissionRoleMapper;
private final ProductionSchedulingMapper productionSchedulingMapper;
+
+ @Autowired
+ LogService logService;
public UserService(UserMapper userMapper, RoleMapper roleMapper, PermissionRoleMapper permissionRoleMapper, UserRoleMapper userRoleMapper, ProductionSchedulingMapper productionSchedulingMapper) {
this.userMapper = userMapper;
@@ -142,6 +147,13 @@
userDTO.setToken(StpUtil.getTokenValue());
Boolean userIsAdmin= userRoleMapper.getUserIsAdmin(user.getId());
userDTO.setPermissions(permissionRoleMapper.getUserEditPermission(user.getId(),userIsAdmin));
+
+ Log log = new Log();
+ log.setOperator(user.getUserName());
+ log.setOperatorId(userDTO.getUserId());
+ log.setContent(userDTO.toString());
+ log.setFunction("鐢ㄦ埛鐧诲綍");
+ logService.saveLog(log);
return userDTO;
}else{
return null;
@@ -208,6 +220,12 @@
return map;
}
+ public Object getUserLog() {
+ Map<String, Object> map = new HashMap<>();
+ map.put("data", userMapper.getUserLog());
+ return map;
+ }
+
//鏌ヨ鐢ㄦ埛浼樺寲鍙傛暟
public String getOptimizeParms(String username) {
diff --git a/north-glass-erp/src/main/resources/mapper/sd/DeliveryDetailMapper.xml b/north-glass-erp/src/main/resources/mapper/sd/DeliveryDetailMapper.xml
index 98993d9..e921024 100644
--- a/north-glass-erp/src/main/resources/mapper/sd/DeliveryDetailMapper.xml
+++ b/north-glass-erp/src/main/resources/mapper/sd/DeliveryDetailMapper.xml
@@ -486,6 +486,7 @@
and od.perimeter regexp #{orderDetail.perimeter}
</if>
</where>
+ order by od.order_id,od.order_number
</select>
<select id="getSelectShippingOrderDetailsPageTotal">
diff --git a/north-glass-erp/src/main/resources/mapper/userInfo/User.xml b/north-glass-erp/src/main/resources/mapper/userInfo/User.xml
index 6629db6..c10d566 100644
--- a/north-glass-erp/src/main/resources/mapper/userInfo/User.xml
+++ b/north-glass-erp/src/main/resources/mapper/userInfo/User.xml
@@ -110,5 +110,10 @@
SELECT optimize_parms FROM erp_user_info.user WHERE user_name = #{username}
</select>
+ <select id="getUserLog" >
+ SELECT operator_id,operator,DATE_FORMAT(create_time, '%Y-%m-%d %H:%i:%s') AS format_create_time
+ FROM erp_log.log
+ WHERE create_time >= DATE_SUB(NOW(), INTERVAL 1 MONTH) and `function`='鐢ㄦ埛鐧诲綍' order by create_time desc limit 0,100
+ </select>
</mapper>
\ No newline at end of file
--
Gitblit v1.8.0