From c377d90fe2a01c2118f6c69c3c177f75be7c318b Mon Sep 17 00:00:00 2001
From: wangfei <3597712270@qq.com>
Date: 星期五, 29 十一月 2024 15:20:51 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
UI-Project/src/views/GlassStorage/rawfilmstorage.vue | 280 +++++++++++++++++++++++++++++++++++++------------------
1 files changed, 187 insertions(+), 93 deletions(-)
diff --git a/UI-Project/src/views/GlassStorage/rawfilmstorage.vue b/UI-Project/src/views/GlassStorage/rawfilmstorage.vue
index aa09737..731eed9 100644
--- a/UI-Project/src/views/GlassStorage/rawfilmstorage.vue
+++ b/UI-Project/src/views/GlassStorage/rawfilmstorage.vue
@@ -1,22 +1,22 @@
<script lang="ts" setup>
-import {Search} from "@element-plus/icons-vue";
-import {reactive} from "vue";
+import {onBeforeUnmount, onMounted, reactive, ref} from "vue";
import {useRouter} from "vue-router"
-const router = useRouter()
-import type { TableColumnCtx } from 'element-plus'
-import { ElMessage, ElMessageBox } from 'element-plus'
-import { useI18n } from 'vue-i18n'
-import { WebSocketHost ,host} from '@/utils/constants'
+import {ElMessage, ElMessageBox} from 'element-plus'
+import {useI18n} from 'vue-i18n'
+import {host, WebSocketHost} from '@/utils/constants'
import request from "@/utils/request"
-import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService';
-import { ref, onMounted, onUnmounted, onBeforeUnmount } from "vue";
+import {closeWebSocket, initializeWebSocket} from '@/utils/WebSocketService';
+
+const router = useRouter()
const tableDataa = ref([])
const tableDatab = ref([])
-const { t } = useI18n()
+const {t} = useI18n()
const add = ref(false)
const dialogFormVisiblea = ref(false)
const dialogFormVisibleb = ref(false)
const dialogFormVisiblec = ref(false)
+const dialogFormVisiblee = ref(false)
+const Edit = ref(false)
const timeRange = ref(["2022-01-01 00:00:00", "2025-01-01 00:00:00"])
const selectValuesa = reactive([]);
const patternWidth = ref('');
@@ -25,15 +25,17 @@
const filmsId = ref('');
const remainQuantity = ref('');
const slot = ref('');
+ const leftingStation = ref('');
+const loadingline = ref('');
let webSocket: WebSocket | null = null;
const value = ref('')
const options = [
{
- value: 1,
+ value: 98,
label: t('film.warehousing1'),
},
{
- value: 2,
+ value: 99,
label: t('film.warehousing2'),
}
]
@@ -55,11 +57,10 @@
});
onMounted(() => {
// closeWebSocket();
- debugger
+ // debugger // 鏂偣
// console.log("--------------webSocket")
socket = initializeWebSocket(socketUrl, handleMessage);
});
-
let socket = null;
const socketUrl = `ws://${WebSocketHost}:${host}/api/glassStorage/api/talk/rawGlass`;
const handleMessage = (data) => {
@@ -68,27 +69,21 @@
}
if(data.rawStationDetailsList !=null){
tableDatab.value = data.rawStationDetailsList[0]
+ console.log(tableDatab.value);
}
};
-// 淇敼鏁伴噺
-const handleConfirmb = async () => {
- let slotId = window.localStorage.getItem('slotId')
- try {
- const response = await request.post('/glassStorage/rawGlassStorageDetails/updateQuantity', {
- slotId: slotId,
- remainQuantity: remainQuantity.value,
- }
- );
- if (response.code === 200) {
- ElMessage.success(response.message);
- dialogFormVisiblec.value = false;
- tableDatab.value = response.data;
- } else {
- ElMessage.error(response.message);
- }
- } catch (error) {
- console.error(error);
- }
+const handleEdit = (row) => {
+ window.localStorage.setItem('slotId', row.slotId)
+ Edit.value = true;
+};
+const handleBinda = (row) => {
+ dialogFormVisibleb.value = true;
+};
+const handleBindc = (row) => {
+ dialogFormVisiblec.value = true;
+};
+const handleBinde = (row) => {
+ dialogFormVisiblee.value = true;
};
// 鍒犻櫎
const deleteWarehousing = async(row) => {
@@ -116,8 +111,72 @@
} catch (error) {
console.error('鍙戠敓閿欒:', error);
}
-};
-
+};
+// 鍘熺墖鍏ュ簱
+const handleup = async () => {
+ try {
+ const response = await request.post('/glassStorage/rawGlassStorageDetails/patternWarehousing', {
+ patternWidth: patternWidth.value,
+ patternHeight: patternHeight.value,
+ patternThickness: patternThickness.value,
+ filmsId: filmsId.value,
+ remainQuantity: remainQuantity.value,
+ slot: slot.value,
+ });
+ if (response.code === 200) {
+ ElMessage.success(response.message);
+ dialogFormVisibleb.value = false;
+ patternWidth.value = '';
+ patternHeight.value = '';
+ patternThickness.value = '';
+ filmsId.value = '';
+ remainQuantity.value = '';
+ slot.value = '';
+ } else {
+ ElMessage.error(response.message);
+ }
+ } catch (error) {
+ console.error(error);
+ }
+};
+// 鍏ュ簱璇锋眰
+const handleupc = async () => {
+ try {
+ var url="/glassStorage/rawGlassStorageDetails/warehousingRequest?leftingStation="+leftingStation.value;
+ const response = await request.post(url)
+ if (response.code == 200) {
+ ElMessage.success(response.message);
+ dialogFormVisiblec.value = false;
+ leftingStation.value = '';
+ } else {
+ // 璇锋眰澶辫触锛屾樉绀洪敊璇秷鎭�
+ ElMessage.error(response.msg);
+ }
+}
+catch (error) {
+ // 澶勭悊閿欒
+ console.error(error);
+ }
+}
+// 鍑哄簱璇锋眰
+const handleupe = async () => {
+ try {
+ var url="/glassStorage/rawGlassStorageDetails/outWarehousingRequest?leftingStation="+leftingStation.value;
+ const response = await request.post(url)
+ if (response.code == 200) {
+ ElMessage.success(response.message);
+ dialogFormVisiblee.value = false;
+ leftingStation.value = '';
+ } else {
+ // 璇锋眰澶辫触锛屾樉绀洪敊璇秷鎭�
+ ElMessage.error(response.msg);
+ }
+}
+catch (error) {
+ // 澶勭悊閿欒
+ console.error(error);
+ }
+}
// 鍑哄簱
const openc = async(row) => {
try {
@@ -172,33 +231,6 @@
ElMessage.error(response.message);
}
};
-// 鍏ュ簱
-const handleConfirma = async () => {
- try {
- const response = await request.post('/glassStorage/rawGlassStorageDetails/patternWarehousing', {
- patternWidth: patternWidth.value,
- patternHeight: patternHeight.value,
- patternThickness: patternThickness.value,
- filmsId: filmsId.value,
- remainQuantity: remainQuantity.value,
- slotId: slot.value,
- });
- if (response.code === 200) {
- ElMessage.success(response.message);
- dialogFormVisibleb.value = false;
- patternWidth.value = '';
- patternHeight.value = '';
- patternThickness.value = '';
- filmsId.value = '';
- remainQuantity.value = '';
- slot.value = '';
- } else {
- ElMessage.error(response.message);
- }
- } catch (error) {
- console.error(error);
- }
-};
// 鏄惁绂佺敤
const toggleEnableState = async (row: any) => {
if (!row.deviceId) {
@@ -213,16 +245,32 @@
ElMessage.success(response.message);
row.state = newState;
} else {
- ElMessage.error(response.message);
- }
- row.state = newState;
+ ElMessage.error(response.message);
+ }
+ row.state = newState;
} catch (error) {
- ElMessage.error(t('basicData.glassnull'));
- }
-};
-const handleEdit = (row) => {
- window.localStorage.setItem('slotId', row.slotId)
- dialogFormVisiblec.value = true;
+ ElMessage.error(t('basicData.glassnull'));
+ }
+};
+// 淇敼鏁伴噺
+const Editclick = async () => {
+ let slotId = window.localStorage.getItem('slotId')
+ try {
+ const response = await request.post('/glassStorage/rawGlassStorageDetails/updateQuantity', {
+ slotId: slotId,
+ remainQuantity: remainQuantity.value,
+ }
+ );
+ if (response.code === 200) {
+ ElMessage.success(response.message);
+ Edit.value = false;
+ tableDatab.value = response.data;
+ } else {
+ ElMessage.error(response.message);
+ }
+ } catch (error) {
+ console.error(error);
+ }
};
function getStatusType1(taskType) {
switch (taskType) {
@@ -274,15 +322,26 @@
});
</script>
<template>
- <div>
- <div style="display: flex; flex-direction: row; align-items: center; margin-top: 20px;">
- <el-button style="margin-left: 20px;" id="searchButton" type="success" @click="dialogFormVisiblea = true">{{ $t('film.mes') }}</el-button>
- <el-button style="margin-left: 20px;" id="searchButton" type="success" @click="dialogFormVisibleb = true">{{ $t('film.warehousing') }}</el-button>
- <el-date-picker style="margin-left: 10px;" v-model="timeRange" type="datetimerange"
- format="YYYY/MM/DD HH:mm:ss"
- value-format="YYYY-MM-DD HH:mm:ss"
- :start-placeholder="$t('film.starttime')"
- :end-placeholder="$t('film.endtime')"
+ <div style="height: 500px;">
+ <div style="display: flex; flex-direction: row; align-items: center; margin-top: 20px;">
+ <el-button style="margin-left: 20px;" id="searchButton" type="success" @click="dialogFormVisiblea = true">
+ {{ $t('film.mes') }}
+ </el-button>
+ <el-button style="margin-left: 20px;" id="searchButton" type="success" @click="handleBinda">
+ {{ $t('film.warehousing') }}
+ </el-button>
+ <el-button style="margin-left: 20px;" id="searchButton" type="success" @click="handleBindc">
+ {{ $t('film.pwarehousing') }}
+ </el-button>
+ <el-button style="margin-left: 20px;" id="searchButton" type="success" @click="handleBinde">{{
+ $t('film.pwareout')
+ }}
+ </el-button>
+ <el-date-picker style="margin-left: 10px;" v-model="timeRange" type="datetimerange"
+ format="YYYY/MM/DD HH:mm:ss"
+ value-format="YYYY-MM-DD HH:mm:ss"
+ :start-placeholder="$t('film.starttime')"
+ :end-placeholder="$t('film.endtime')"
:default-time="defaultTime" />
<el-select v-model="selectValuesa[0]" clearable :placeholder="$t('film.taskstatus')" style="margin-left: 10px;" >
<el-option :label="$t('film.built')" value="1"></el-option>
@@ -327,19 +386,18 @@
</template>
</el-table-column>
<el-table-column prop="createTime" align="center" :label="$t('film.createtime')" />
-
</el-table>
</div>
</el-card>
<div class="awatch">
- <img src="../../assets/ypcc.png" alt="" style="width: 100%;height: 120%;margin-left: 10px;position: relative;margin-top: -20px;">
-
-</div>
+ <img src="../../assets/ypcc.png" alt=""
+ style="width: 100%;height: 120%;margin-left: -10px;position: relative;margin-top: -20px;">
+ </div>
<el-dialog v-model="dialogFormVisiblea" top="5vh" width="85%" >
<el-table ref="table" style="margin-top: 20px;height: 700px;"
:data="tableDatab" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}">
<el-table-column prop="deviceId" fixed align="center" :label="$t('film.station')" min-width="80"/>
- <el-table-column prop="slotId" fixed align="center" :label="$t('film.slot')" min-width="80"/>
+ <el-table-column prop="slot" fixed align="center" :label="$t('film.slot')" min-width="80"/>
<el-table-column prop="patternWidth" align="center" :label="$t('film.width')" min-width="80" />
<el-table-column prop="patternHeight" align="center" :label="$t('film.height')" min-width="80" />
<el-table-column prop="patternThickness" align="center" :label="$t('film.thickness')" min-width="80" />
@@ -362,14 +420,14 @@
</el-table-column>
<el-table-column fixed="right" :label="$t('film.operate')" align="center" width="270">
<template #default="scope">
- <el-button size="mini" type="text" plain @click="handleEdit(scope.row)">{{ $t('film.exit') }}</el-button>
- <el-button size="mini" type="text" plain @click="deleteWarehousing(scope.row)">{{ $t('film.delete') }}</el-button>
- <el-button size="mini" type="text" plain @click="openc(scope.row)">{{ $t('film.outbound') }}</el-button>
+ <el-button :disabled="!scope.row.remainQuantity" size="mini" type="text" plain @click="handleEdit(scope.row)">{{ $t('film.exit') }}</el-button>
+ <el-button :disabled="!scope.row.remainQuantity" size="mini" type="text" plain @click="deleteWarehousing(scope.row)">{{ $t('film.delete') }}</el-button>
+ <el-button :disabled="!scope.row.remainQuantity || scope.row.remainQuantity === 0" size="mini" type="text" plain @click="openc(scope.row)">{{ $t('film.outbound') }}</el-button>
</template>
</el-table-column>
</el-table>
</el-dialog>
-<el-dialog v-model="dialogFormVisibleb" top="23vh" width="55%" :title="$t('basicData.addglass')" >
+<el-dialog v-model="dialogFormVisibleb" top="23vh" width="55%" :title="$t('film.addglass')" >
<div style="margin-left: -50px;margin-top: 10px;margin-bottom: 10px;">
<el-form size="mini" label-width="150px">
<el-form label-width="100px" label-position="right">
@@ -438,14 +496,50 @@
</div>
<template #footer>
<div id="dialog-footer">
- <el-button type="primary" @click="handleConfirma">
+ <el-button type="primary" @click="handleup">
{{ $t('basicData.confirm') }}
</el-button>
<el-button @click="dialogFormVisibleb = false">{{ $t('basicData.cancel') }}</el-button>
</div>
</template>
</el-dialog>
-<el-dialog v-model="dialogFormVisiblec" top="21vh" width="40%">
+<el-dialog v-model="dialogFormVisiblec" top="24vh" width="30%" :title="$t('film.pwarehousing')">
+ <div style="margin-left: 50px;margin-bottom: 10px;">
+ <el-form-item :label="$t('film.position')" :required="true">
+ <el-select v-model="leftingStation" clearable :placeholder="$t('film.cposition')" style="margin-left: 20px;" >
+ <el-option :label="$t('film.position1')" value="98"></el-option>
+ <el-option :label="$t('film.position2')" value="99"></el-option>
+ </el-select>
+ </el-form-item>
+ </div>
+ <template #footer>
+ <div id="dialog-footer">
+ <el-button type="primary" @click="handleupc">
+ {{ $t('basicData.confirm') }}
+ </el-button>
+ <el-button @click="dialogFormVisiblec = false">{{ $t('basicData.cancel') }}</el-button>
+ </div>
+ </template>
+ </el-dialog>
+<el-dialog v-model="dialogFormVisiblee" top="24vh" width="30%" :title="$t('film.pwareout')">
+ <div style="margin-left: 50px;margin-bottom: 10px;">
+ <el-form-item :label="$t('film.position')" :required="true">
+ <el-select v-model="leftingStation" clearable :placeholder="$t('film.cposition')" style="margin-left: 20px;" >
+ <el-option :label="$t('film.position1')" value="98"></el-option>
+ <el-option :label="$t('film.position2')" value="99"></el-option>
+ </el-select>
+ </el-form-item>
+ </div>
+ <template #footer>
+ <div id="dialog-footer">
+ <el-button type="primary" @click="handleupe">
+ {{ $t('basicData.confirm') }}
+ </el-button>
+ <el-button @click="dialogFormVisiblee = false">{{ $t('basicData.cancel') }}</el-button>
+ </div>
+ </template>
+ </el-dialog>
+ <el-dialog v-model="Edit" top="21vh" width="40%">
<div style="margin-left: 50px;margin-top: 10px;margin-bottom: 10px;">
<el-form size="mini" label-width="100px">
<el-form label-width="210px" label-position="right">
@@ -457,10 +551,10 @@
</div>
<template #footer>
<div id="dialog-footer">
- <el-button type="primary" @click="handleConfirmb">
+ <el-button type="primary" @click="Editclick">
{{ $t('reportWork.sure') }}
</el-button>
- <el-button @click="dialogFormVisiblec = false">{{ $t('reportWork.cancel') }}</el-button>
+ <el-button @click="Edit = false">{{ $t('reportWork.cancel') }}</el-button>
</div>
</template>
</el-dialog>
--
Gitblit v1.8.0