From 1460aa1d5f2b5722d43ed31724594c006213bea7 Mon Sep 17 00:00:00 2001
From: huang <1532065656@qq.com>
Date: 星期五, 18 四月 2025 16:40:43 +0800
Subject: [PATCH] 看板2更新
---
UI-Project/src/views/ManualReporting/manualReporting.vue | 122 +++++++++++++++++++++++++++++-----------
1 files changed, 87 insertions(+), 35 deletions(-)
diff --git a/UI-Project/src/views/ManualReporting/manualReporting.vue b/UI-Project/src/views/ManualReporting/manualReporting.vue
index 52b8c31..c7c992c 100644
--- a/UI-Project/src/views/ManualReporting/manualReporting.vue
+++ b/UI-Project/src/views/ManualReporting/manualReporting.vue
@@ -6,6 +6,7 @@
import { useI18n } from 'vue-i18n'
import { WebSocketHost, host } from '@/utils/constants'
import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService';
+import {gridDateFormatter,getDataSort} from '@/stores/tool';
let language = ref(localStorage.getItem('lang') || 'zh')
const { t } = useI18n()
const requestData = reactive({
@@ -15,6 +16,7 @@
const blind = ref(false)
const errorInfo = ref(true)
const loadData = ref([]);
+const taskinggoruby = ref([]);
const findMachine = ref([]);
const sendRecords = ref([]);
const downLineTask = ref([]);
@@ -22,8 +24,13 @@
const scanCodeOld = ref([]);
const searcheh = ref();
-const machineId = 2;//褰撳墠椤甸潰鐨勮澶嘔D
+const userInfo=JSON.parse(window.localStorage.getItem('userInfo'));
+const pageParams=userInfo.user.menus[0].pages[6].params;
+const pageParamsJson=JSON.parse(pageParams);
+const machineId = pageParamsJson.machineId;//褰撳墠椤甸潰鐨勮澶嘔D
+console.log(machineId);
var errorScanId;
+var errorOpen=false;
//浣跨敤WebSocket鏂瑰紡灞曠ず鏁版嵁
let socket = null;
let socketDownLineTask = null;
@@ -32,15 +39,23 @@
// 瀹氫箟娑堟伅澶勭悊鍑芥暟锛屾洿鏂� receivedData 鍙橀噺
const handleMessage = (data) => {
// 鏇存柊 tableData 鐨勬暟鎹�
- loadData.value = data.taskingList[0];
- findMachine.value = data.machine[0];
- scanCode.value = data.scanCode[0];
- sendRecords.value = data.sendRecords[0].reverse();
+ //taskinggoruby.value = data.taskinggoruby[0];
+ //loadData.value =getDataSort(data.taskingList[0]);
+ const dataJson = data[""+machineId][0];
+ loadData.value = dataJson.taskingList[0];
+ findMachine.value = dataJson.machine[0];
- if(scanCode.value.length>0&&scanCode.value[0].scanId.toString()!=errorScanId){
+ if(findMachine.value.remark.toString()!=errorScanId&&findMachine.value.remark.toString()!=""&&findMachine.value.remark.toString()!=undefined){
//鏈夋暟鎹氨寮圭獥
- errorScanId=scanCode.value[0].scanId.toString();
- errorInfoFuntion(scanCode.value[0]);
+ if(errorOpen){
+ ElMessageBox.close();
+ }
+ errorScanId=findMachine.value.remark.toString();
+ errorInfoFuntion(findMachine.value.remark.toString());
+ errorOpen=true;
+ }else if(findMachine.value.remark.toString()==""&&errorOpen){
+ ElMessageBox.close();
+ errorOpen=false;
}
};
@@ -70,7 +85,7 @@
});
//鎶ヨ鎻愮ず
const errorInfoFuntion = async (info) => {
- let infoScancode='鎵爜ID锛�'+info.scanId+' '+info.scanCode;
+ let infoScancode=info;
ElMessageBox.confirm(
infoScancode,
t('delivery.prompt'),
@@ -81,17 +96,6 @@
}
)
.then(() => {
- //閲嶆柊琛ュ崟
- request.post("/deviceInteraction/tasking/glassAgainTopLine",
- {
- "scanId": info.scanId,
- }).then((res) => { // 鏇挎崲涓轰綘鐨凙PI绔偣
- if (res.code === 200) {
- ElMessage.success(res.message);
- } else {
- ElMessage.warning(res.message)
- }
- })
})
.catch(() => {
ElMessage({
@@ -241,9 +245,27 @@
blind.value = true;
}
const fetchData = async () => {
+ setTimeout(()=>{
+ //鎵爜鍥炶溅鍚庡欢杩熶竴绉�
+ //alert(searcheh.value);
+ //涓嬬嚎鎺ュ彛
+ let scanId= searcheh.value;
+ request.post("/deviceInteraction/tasking/scanMachineAdd",
+ {
+ "machineId": machineId,
+ "scanId": scanId
+ }).then((res) => { // 鏇挎崲涓轰綘鐨凙PI绔偣
+ if (res.code === 200) {
+ ElMessage.success(res.message);
+ } else {
+ ElMessage.warning(res.message)
+ }
+ })
+ searcheh.value="";
+ },1000);
+
//鎵爜鍥炶溅鎻愪氦
- alert(searcheh.value);
- searcheh.value="";
+ //searcheh.value="";
}
//涓婄嚎
const topLine = async (row) => {
@@ -280,6 +302,40 @@
const handleDialogClose = () => {
}
+//鍏ㄩ儴鎻愪氦
+const reportForWork = async () => {
+ let infoReport = "鏄惁鎻愪氦 "+loadData.value.length+" 鐗囩幓鐠�?";
+ ElMessageBox.confirm(
+ infoReport,
+ t('delivery.prompt'),
+ {
+ confirmButtonText: t('functionState.sure'),
+ cancelButtonText: t('functionState.cancel'),
+ type: 'warning',
+ }
+ )
+ .then(() => {
+ //涓嬬嚎鎺ュ彛
+ request.post("/deviceInteraction/tasking/reportForWork",
+ {
+ "id": machineId,
+ }).then((res) => { // 鏇挎崲涓轰綘鐨凙PI绔偣
+ if (res.code === 200) {
+ ElMessage.success(res.message);
+ } else {
+ ElMessage.warning(res.message)
+ }
+ })
+ })
+ .catch(() => {
+ ElMessage({
+ type: 'info',
+ message: t('functionState.cancel'),
+ })
+ })
+}
+
+
</script>
<template>
<div ref="content" style="padding:0 20px;">
@@ -296,7 +352,8 @@
<br>
<div id="search" style="height:35px;line-height: 35px;">
<!-- 鍔熻兘 -->
- <el-button type="primary" id="ButtonTopLine" @click="topLineShow">{{ $t('functionState.reporting') }}</el-button>
+ <el-button type="primary" id="ButtonTopLine" @click="reportForWork">{{ $t('functionState.reporting') }}</el-button>
+ <!-- <el-button type="primary" id="ButtonTopLine" @click="topLineShow">{{ $t('functionState.reporting') }}</el-button> -->
<el-input v-model="searcheh" type="primary" id="ReportSubmission" @keyup.enter="fetchData"
style="width:1000px;height:35px;line-height: 35px;font-size: 35px;float: right;"></el-input>
@@ -305,7 +362,7 @@
<div id="main-body" style="min-height:240px;">
<!-- 琛ㄦ牸鍐呭 -->
- <el-table :data="loadData" stripe
+ <el-table :data="taskinggoruby" stripe
:header-cell-style="{ background: '#F2F3F5 ', color: '#1D2129', textAlign: 'center' }"
:cell-style="{ textAlign: 'center' }">
<!-- <el-table-column type="selection" min-width="30" /> -->
@@ -319,21 +376,16 @@
<el-icon @click="fetchData"><CaretBottom /></el-icon>
<el-icon color="#409efc"><Filter /></el-icon>
</div>
-
-
<!-- <el-input size="small" placeholder="Type to search" /> -->
-
</div>
-
</template>
</el-table-column>
<el-table-column prop="scanId" :label="$t('glassInfo.scanId')" />
<el-table-column prop="taskQuantity" :label="$t('glassInfo.taskQuantity')" />
<el-table-column prop="reportCount" :label="$t('glassInfo.reportCount')" />
+
<el-table-column fixed="right" :label="$t('productStock.operate')" align="center" width="270">
<template #default="scope">
- <el-button size="mini" link type="primary" plain @click="workStatus(scope.row, '瀹屽伐')">{{
- $t('functionState.finish') }}</el-button>
<el-button size="mini" link type="primary" plain @click="damagedTask(scope.row)">{{ $t('functionState.lose')
}}</el-button>
</template>
@@ -348,17 +400,17 @@
:cell-style="{ textAlign: 'center' }">
<!-- <el-table-column type="selection" min-width="30" /> -->
<el-table-column type="index" :label="$t('glassInfo.number')" min-width="30" />
- <el-table-column prop="batchNumber" :label="$t('glassInfo.batchNumber')" />
<el-table-column prop="taskType" :label="$t('glassInfo.taskType')" />
- <el-table-column prop="glassId" :label="$t('glassInfo.glassId')" />
+
<el-table-column prop="length" :label="$t('glassInfo.length')" />
<el-table-column prop="width" :label="$t('glassInfo.width')" />
<el-table-column prop="thickness" :label="$t('glassInfo.thickness')" />
- <el-table-column prop="workState" :label="$t('glassInfo.workState')" />
+ <el-table-column prop="operationRecordTime" :formatter="gridDateFormatter" :label="$t('glassInfo.operationRecordTime')" width="180"/>
+ <el-table-column prop="batchNumber" :label="$t('glassInfo.batchNumber')" />
+ <el-table-column prop="scanId" :label="$t('glassInfo.scanId')" />
+ <el-table-column prop="warehouse" :label="$t('glassInfo.warehouse')" />
<el-table-column fixed="right" :label="$t('productStock.operate')" align="center" width="270">
<template #default="scope">
- <el-button size="mini" link type="primary" plain @click="workStatus(scope.row, '瀹屽伐')">{{
- $t('functionState.finish') }}</el-button>
<el-button size="mini" link type="primary" plain @click="damagedTask(scope.row)">{{ $t('functionState.lose')
}}</el-button>
</template>
--
Gitblit v1.8.0