From eae89f75a208938dba8787a73f68a8ae2e44e165 Mon Sep 17 00:00:00 2001
From: zhoushihao <zsh19950802@163.com>
Date: 星期一, 23 十二月 2024 10:20:37 +0800
Subject: [PATCH] 1、指定钢化工程接口
---
UI-Project/src/views/Returns/returns.vue | 126 +++++++++++++++++++++++------------------
1 files changed, 70 insertions(+), 56 deletions(-)
diff --git a/UI-Project/src/views/Returns/returns.vue b/UI-Project/src/views/Returns/returns.vue
index cf28409..3ac8c56 100644
--- a/UI-Project/src/views/Returns/returns.vue
+++ b/UI-Project/src/views/Returns/returns.vue
@@ -6,7 +6,6 @@
import {host, WebSocketHost} from '@/utils/constants'
import request from "@/utils/request"
import {closeWebSocket, initializeWebSocket} from '@/utils/WebSocketService';
-
const router = useRouter()
const {t} = useI18n()
const dialogFormVisible = ref(false)
@@ -60,7 +59,6 @@
const uniqueHeights = new Set(response.data.map(item => item.height));
const uniqueFilmsIds = new Set(response.data.map(item => item.filmsId));
const uniqueThicknesses = new Set(response.data.map(item => item.thickness));
-
selectOptions.value = Array.from(uniqueWidths).map(width => ({
value: width,
label: width,
@@ -81,7 +79,6 @@
ElMessage.error(response.message);
}
} catch (error) {
- // 澶勭悊璇锋眰澶辫触鐨勬儏鍐�
// ElMessage.error('鑾峰彇琛ㄦ牸鏁版嵁澶辫触锛岃閲嶈瘯');
}
};
@@ -92,6 +89,10 @@
const selectproject = () => {
dialogFormVisible.value = true;
selectgong();
+};
+// 鍒犻櫎
+const handledelete = (row) => {
+ blindb.value = true;
};
// 鍊肩彮淇℃伅
const fetchFlowCardId = async () => {
@@ -105,6 +106,33 @@
tableDatax.value = response.data;
} else {
ElMessage.error(response.message);
+ }
+}
+catch (error) {
+ console.error(error);
+ }
+}
+// 鍒犻櫎
+const deleteTask = async () => {
+ try {
+ let engineeringId = window.localStorage.getItem('engineeringId')
+ console.log(engineeringId);
+ if (engineeringId !== '') {
+ const response = await request.post('/loadGlass/engineering/engineering/deleteTask', {
+ engineerId: engineeringId,
+ })
+ if (response.code == 200) {
+ ElMessage.success(response.message);
+ blindb.value = false;
+ } else {
+ ElMessage.error(response.message);
+ }
+ }
+ else {
+ ElMessage({
+ type: 'info',
+ message: t('basicData.infonull'),
+ })
}
}
catch (error) {
@@ -184,7 +212,7 @@
if(data.InkageStatus!=null){
const status = data.InkageStatus[0];
cuttingMachine.value = status;
- upstatus.value = status === '1' ? t('basicData.machine') : t('basicData.machineaa');
+ upstatus.value = status === '1' ? t('basicData.machine') : t('basicData.machineaa');
cuttingMachineStatusColor.value = status === '1' ? 'green' : '#911005';
inKageWord.value = status === '1' ? 0 : 1;
}
@@ -232,13 +260,12 @@
} else {
options.value = [];
}
-};
- // 澶勭悊鐢ㄦ埛杈撳叆鍙樺寲鐨勬柟娉�
+};
const handleInputChangea = async (value: string) => {
if (value) {
await fetchOptionsa(value);
} else {
- options.value = []; // 娓呯┖閫夐」鍒楄〃
+ options.value = [];
}
};
onBeforeUnmount(() => {
@@ -285,8 +312,7 @@
} else {
ElMessage.error(response.message);
}
- } catch (error) {
- // 澶勭悊璇锋眰閿欒
+ } catch (error) {
}
}
else if( ida.value === 1 || ida.value === 3){
@@ -320,11 +346,9 @@
number.value = '';
list()
} else {
- // 璇锋眰澶辫触锛屾樉绀洪敊璇秷鎭�
ElMessage.error(response.message);
}
- } catch (error) {
- // 澶勭悊璇锋眰閿欒
+ } catch (error) {
}
}
else {
@@ -498,9 +522,9 @@
case 1:
return t('basicData.up');
case 2:
- return t('basicData.up');
+ return t('basicData.up');
case 100:
- return t('basicData.finish');
+ return t('basicData.finish');
}
}
function getStatusType(state: number) {
@@ -523,16 +547,11 @@
const handleBinda = (row) => {
blinda.value = true;
};
-// 鍋滄浠诲姟
-const handleBindb = (row) => {
- blindb.value = true;
-};
// 鍒犻櫎
const handleBindRacka = (row) => {
workstationId.value = row.workstationId;
adda.value = true;
};
-// 瀹氫箟涓�涓搷搴斿紡寮曠敤锛岀敤浜庡瓨鍌ㄩ鑹茬姸鎬�
const markingMachineStatus = ref('#911005');
const cuttingMachineStatus = ref('#911005');
// 瀹氫箟涓�涓柟娉曟潵鏀瑰彉棰滆壊鐘舵��
@@ -543,14 +562,12 @@
cuttingMachineStatus.value = 'green';
};
const toggleEnableState = async (row: any) => {
- // 妫�鏌� id 鏄惁涓虹┖
if (!row.id) {
ElMessage.error(t('basicData.updatanull'));
- return; // 濡傛灉 id 涓虹┖锛屽垯涓嶆墽琛屽悗缁搷浣�
+ return;
}
const newState = row.state === 100 ? 0 : 100;
- try {
- // 鍙戦�佽姹傚埌鍚庣鏇存柊鐘舵��
+ try {
const response = await request.post('/loadGlass/up-patten-usage/updateGlassState', { id: row.id, state: newState });
if (response.code === 200) {
ElMessage.success(response.message);
@@ -559,7 +576,6 @@
ElMessage.error(response.message);
}
} catch (error) {
- // 澶勭悊璇锋眰閿欒
ElMessage.error(t('basicData.glassnull'));
}
};
@@ -579,28 +595,37 @@
} catch (error) {
console.error('璇锋眰鏃跺彂鐢熼敊璇�', error);
ElMessage.error('璇锋眰鏃跺彂鐢熼敊璇�');
- }
+ }
};
</script>
<template>
- <div>
- <div id="dotClass">
- <div>{{ $t('basicData.laserprinting') }}</div>
- <i :style="{ marginTop: '2px', backgroundColor: markingMachineStatus, width: '18px', height: '18px', borderRadius: '50%', display: 'block' }"></i>
- <el-button @click="confirmMarkingMachine" style="margin-left: 30px;margin-top: -3px;">{{ $t('basicData.yes') }}</el-button>
- <div style="margin-left: 70px;">{{ $t('basicData.cuttingmachine') }}</div>
- <i :style="{ marginTop: '2px', backgroundColor: cuttingMachineStatus, width: '18px', height: '18px', borderRadius: '50%', display: 'block' }"></i>
- <el-button @click="confirmCuttingMachine" style="margin-left: 30px;margin-top: -3px;" >{{ $t('basicData.yes') }}</el-button>
- <div style="margin-left: 70px;">{{ upstatus }} </div>
- <i :style="{ marginTop: '2px', backgroundColor: cuttingMachineStatusColor, width: '18px', height: '18px', borderRadius: '50%', display: 'block' }"></i>
- <el-button @click="confirmCutting" style="margin-left: 30px;margin-top: -3px;" >{{ $t('basicData.change') }}</el-button>
-
+ <div style="height: 500px;">
+ <div>
+ <div id="dotClass">
+ <div>{{ $t('basicData.laserprinting') }}</div>
+ <i :style="{ marginTop: '2px', backgroundColor: markingMachineStatus, width: '18px', height: '18px', borderRadius: '50%', display: 'block' }"></i>
+ <el-button @click="confirmMarkingMachine" style="margin-left: 30px;margin-top: -3px;">{{
+ $t('basicData.yes')
+ }}
+ </el-button>
+ <div style="margin-left: 70px;">{{ $t('basicData.cuttingmachine') }}</div>
+ <i :style="{ marginTop: '2px', backgroundColor: cuttingMachineStatus, width: '18px', height: '18px', borderRadius: '50%', display: 'block' }"></i>
+ <el-button @click="confirmCuttingMachine" style="margin-left: 30px;margin-top: -3px;">{{
+ $t('basicData.yes')
+ }}
+ </el-button>
+ <div style="margin-left: 70px;">{{ upstatus }}</div>
+ <i :style="{ marginTop: '2px', backgroundColor: cuttingMachineStatusColor, width: '18px', height: '18px', borderRadius: '50%', display: 'block' }"></i>
+ <el-button @click="confirmCutting" style="margin-left: 30px;margin-top: -3px;">{{
+ $t('basicData.change')
+ }}
+ </el-button>
</div>
<el-button :disabled="!canSelectProject" style="margin-top: 5px;margin-left: 15px;" type="primary" @click="selectproject">{{ $t('basicData.selectproject') }}</el-button>
<el-button :disabled="!canSelectProject" :style="{ backgroundColor: canStartLoading ? 'green' : 'initial',color: canStartLoading ? 'white' : 'black', }" style="margin-top: 5px;margin-left: 20px;" @click="handleBind">{{ $t('basicData.startloading') }}</el-button>
<el-button style="margin-top: 5px;margin-left: 20px;" id="searchButton" type="warning" @click="handleBinda">{{ $t('basicData.stop') }}</el-button>
+ <el-button style="margin-top: 5px;margin-left: 20px;" id="searchButton" type="danger" @click="handledelete">{{ $t('searchOrder.deleteTask') }}</el-button>
<el-button style="margin-top: 5px;margin-left: 20px;" id="searchButton" type="info" @click="handlezhiban">{{ $t('searchOrder.dutyinformation') }}</el-button>
- <!-- <el-button style="margin-top: 5px;margin-left: 20px;" id="searchButton" type="danger" @click="handleBindb">鍋滄浠诲姟</el-button> -->
<el-card style="flex: 1;margin-left: 10px;margin-top: 15px;" v-loading="loading">
<div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;">
<el-table
@@ -621,17 +646,6 @@
</template>
</el-table-column>
<el-table-column prop="thickness" :label="$t('basicData.thickness')" align="center"/>
- <!-- <el-table-column
- align="center"
- label="鐘舵��"
- min-width="80"
- prop="state"
- >
- <template #default="scope">
- <el-tag :type="getStatusType(scope.row.state)">
- {{ getStatusText(scope.row.state) }}
- </el-tag>
- </template> -->
<el-table-column
align="center"
:label="$t('basicData.startstatus')"
@@ -695,16 +709,16 @@
</div>
</template>
</el-dialog>
- <!-- <el-dialog v-model="blindb" top="30vh" width="25%" title="鏄惁鍋滄浠诲姟?" >
+ <el-dialog v-model="blindb" top="30vh" width="25%" :title="$t('searchOrder.pdeleteTask')">
<template #footer>
<div id="dialog-footer">
- <el-button type="primary" @click="handleb">
- 纭
+ <el-button type="primary" @click="deleteTask">
+ {{ $t('basicData.confirm') }}
</el-button>
- <el-button @click="blindb = false">鍙栨秷</el-button>
+ <el-button @click="blindb = false">{{ $t('basicData.cancel') }}</el-button>
</div>
</template>
- </el-dialog> -->
+ </el-dialog>
<div id="parent">
<img src="../../assets/shangpian.png" alt="" style="max-width: 40%;max-height: 40%;margin-top: 20px;margin-left: 340px;">
<div id="overlay" v-show="flake"></div>
@@ -819,8 +833,7 @@
:label="item.label"
:value="item.value"
/>
- </el-select>
- <!-- <el-input v-model="patternThickness" autocomplete="off" /> -->
+ </el-select>
</el-form-item></div></div>
</el-col>
</el-row>
@@ -885,6 +898,7 @@
</div>
</template>
</el-dialog>
+ </div>
</template>
<style scoped>
#dt { display:block; float:left;line-height: 20px;margin-left: 100px;}
--
Gitblit v1.8.0