From f38a8c1d95e84d609faf6133071eb789e7e0ec1d Mon Sep 17 00:00:00 2001 From: wangfei <3597712270@qq.com> Date: 星期二, 24 九月 2024 15:13:46 +0800 Subject: [PATCH] 钢化模块进炉中解决一炉时数据不推送页面显示不消失问题 --- UI-Project/src/views/GlassStorage/rawfilmstorage.vue | 158 +++++++++++++++++++++++++++++++++++----------------- 1 files changed, 106 insertions(+), 52 deletions(-) diff --git a/UI-Project/src/views/GlassStorage/rawfilmstorage.vue b/UI-Project/src/views/GlassStorage/rawfilmstorage.vue index a4e1d04..d34ea16 100644 --- a/UI-Project/src/views/GlassStorage/rawfilmstorage.vue +++ b/UI-Project/src/views/GlassStorage/rawfilmstorage.vue @@ -19,22 +19,48 @@ const dialogFormVisiblec = ref(false) const timeRange = ref(["2022-01-01 00:00:00", "2025-01-01 00:00:00"]) const selectValuesa = reactive([]); -let webSocket: WebSocket | null = null; + const patternWidth = ref(''); + const patternHeight = ref(''); + const patternThickness = ref(''); + const filmsId = ref(''); + const remainQuantity = ref(''); + const slot = ref(''); + let webSocket: WebSocket | null = null; const value = ref('') const options = [ { - value: t('film.warehousing1'), + value: 1, label: t('film.warehousing1'), }, { - value: t('film.warehousing2'), + value: 2, label: t('film.warehousing2'), } ] const report = ref({ - enableType: '', - enableState: '', + taskType: '', + taskState: '', }); +// const response = await request.post("/glassStorage/rawGlassStorageTask/setRawGlassTaskRequest", { +// beginDate: timeRange.value[0], +// endDate: timeRange.value[1], +// taskState: stateList, +// taskType: celllist +// }) +// if (response.code === 200) { +// // tableDataa.value = response.data; +request.post("/glassStorage/rawGlassStorageTask/setRawGlassTaskRequest",{ + beginDate: "2022-01-01 00:00:00", + endDate: "2025-01-01 00:00:00", +}).then((response) => { + if (response.code == 200) { + tableDataa.value = response.data + console.log(tableDataa.value); + } else { + ElMessage.warning(response.msg) + + } + }); onMounted(() => { socket = initializeWebSocket(socketUrl, handleMessage); }); @@ -48,8 +74,6 @@ const handleMessage = (data) => { if(data.tasks !=null){ tableDataa.value = data.tasks[0] - console.log(data.tasks[0]); - } if(data.rawStationDetailsList !=null){ tableDatab.value = data.rawStationDetailsList[0] @@ -141,18 +165,45 @@ stateList=[selectValuesa[1]]; } } - const response = await request.post("/glassStorage/raw_glass_storage_task/selectRawglasstask", { - createTime: timeRange.value[0], - patternQuantity: timeRange.value[1], - enableType: stateList, - enableState: celllist + const response = await request.post("/glassStorage/rawGlassStorageTask/setRawGlassTaskRequest", { + beginDate: timeRange.value[0], + endDate: timeRange.value[1], + taskState: stateList, + taskType: celllist }) if (response.code === 200) { - tableDataa.value = response.data; + // tableDataa.value = response.data; ElMessage.success(response.message); } else { 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, + 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); } }; // 鏄惁绂佺敤 @@ -178,8 +229,8 @@ const handleEdit = (row) => { dialogFormVisiblec.value = true; }; -function getStatusType1(enableType) { -switch (enableType) { +function getStatusType1(taskType) { +switch (taskType) { case 1: return 'info'; case 2: @@ -188,8 +239,8 @@ return 'success'; } } -function getStatusText1(enableType) { -switch (enableType) { +function getStatusText1(taskType) { +switch (taskType) { case 1: return t('film.stocke');//鍏ュ簱 case 2: @@ -198,8 +249,8 @@ return t('film.dispatch');//璋冨害 } } -function getStatusType2(enableState) { -switch (enableState) { +function getStatusType2(taskState) { +switch (taskState) { case 1: return 'info'; case 2: @@ -208,8 +259,8 @@ return 'success'; } } -function getStatusText2(enableState) { -switch (enableState) { +function getStatusText2(taskState) { +switch (taskState) { case 1: return t('film.built');//鏂板缓 case 2: @@ -249,29 +300,29 @@ <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;"> <el-table height="300" ref="table" :data="tableDataa" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> - <el-table-column prop="enableId" align="center" :label="$t('film.enableid')"/> + <el-table-column prop="id" align="center" :label="$t('film.enableid')"/> <el-table-column prop="originateSlot" align="center" :label="$t('film.originateslot')"/> <el-table-column prop="endSlot" align="center" :label="$t('film.endslot')"/> <el-table-column prop="patternQuantity" align="center" :label="$t('film.patternquantity')"/> <el-table-column align="center" :label="$t('film.enabletype')" - prop="enableType" + prop="taskType" > <template #default="scope"> - <el-tag :type="getStatusType1(scope.row.enableType)"> - {{ getStatusText1(scope.row.enableType) }} + <el-tag :type="getStatusType1(scope.row.taskType)"> + {{ getStatusText1(scope.row.taskType) }} </el-tag> </template> </el-table-column> <el-table-column align="center" - :label="$t('film.enablestate')" - prop="enableState" + :label="$t('film.taskstatus')" + prop="taskState" > <template #default="scope"> - <el-tag :type="getStatusType2(scope.row.enableState)"> - {{ getStatusText2(scope.row.enableState) }} + <el-tag :type="getStatusType2(scope.row.taskState)"> + {{ getStatusText2(scope.row.taskState) }} </el-tag> </template> </el-table-column> @@ -288,6 +339,7 @@ <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="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" /> @@ -317,16 +369,16 @@ </el-table-column> </el-table> </el-dialog> -<el-dialog v-model="dialogFormVisibleb" top="15vh" width="60%"> - <div style="margin-top: 10px;margin-bottom: 10px;"> - <el-form size="mini" label-width="150px"> - <el-form label-width="70vm" label-position="right"> - <el-row > +<el-dialog v-model="dialogFormVisibleb" top="23vh" width="55%" :title="$t('basicData.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"> + <el-row style="margin-top: -15px;margin-bottom: -2px;"> <el-col :span="6"> <div id="dt" style="font-size: 15px;"> <div> <el-form-item :label="$t('film.widtha')" :required="true" style="width: 17vw;"> - <el-input :placeholder="$t('film.inwidth')" v-model="number" autocomplete="off" /> + <el-input :placeholder="$t('film.inwidth')" v-model="patternWidth" autocomplete="off" /> </el-form-item> </div></div> </el-col> @@ -334,7 +386,7 @@ <div id="dta" style="font-size: 15px;"> <div> <el-form-item :label="$t('film.heighta')" :required="true" style="width: 17vw;"> - <el-input :placeholder="$t('film.inheight')" v-model="number" autocomplete="off" /> + <el-input :placeholder="$t('film.inheight')" v-model="patternHeight" autocomplete="off" /> </el-form-item></div> </div> </el-col> @@ -344,14 +396,14 @@ <div id="dt" style="font-size: 15px;"> <div> <el-form-item :label="$t('film.thicknessa')" :required="true" style="width: 17vw;"> - <el-input :placeholder="$t('film.inthickness')" v-model="number" autocomplete="off" /> + <el-input :placeholder="$t('film.inthickness')" v-model="patternThickness" autocomplete="off" /> </el-form-item></div></div> </el-col> <el-col :span="9"> <div id="dta" style="font-size: 15px;"> <div> <el-form-item :label="$t('film.filmsa')" :required="true" style="width: 17vw;"> - <el-input :placeholder="$t('film.infilms')" v-model="number" autocomplete="off" /> + <el-input :placeholder="$t('film.infilms')" v-model="filmsId" autocomplete="off" /> </el-form-item></div></div> </el-col> </el-row> @@ -359,24 +411,26 @@ <el-col :span="6"> <div id="dt" style="font-size: 15px;"> <div> - <el-form-item :label="$t('film.quantitya')" :required="true" style="width: 17vw;"> - <el-input :placeholder="$t('film.inquantity')" v-model="number" autocomplete="off" /> + <el-form-item :label="$t('film.quantitya')" :required="true" style="width: 17vw;"> + <el-input :placeholder="$t('film.inquantity')" v-model="remainQuantity" autocomplete="off" /> </el-form-item></div></div> </el-col> <el-col :span="9"> <div id="dta" style="font-size: 15px;"> <div> <el-form-item :label="$t('film.inwarehousing')" :required="true" style="width: 17vw"> - <el-select :placeholder="$t('film.selectwarehousing')"> - <el-option - v-for="item in options" - :key="item.value" - :label="item.label" - :value="item.value" - /> + <el-select + :placeholder="$t('film.selectwarehousing')" + style="width: 270px" + v-model="slot"> + <el-option + v-for="item in options" + :key="item.value" + :label="item.label" + :value="item.value" + /> </el-select> - </el-form-item></div> - </div> + </el-form-item></div></div> </el-col> </el-row> </el-form> @@ -384,13 +438,13 @@ </div> <template #footer> <div id="dialog-footer"> - <el-button type="primary" @click="handleConfirm"> + <el-button type="primary" @click="handleConfirma"> {{ $t('basicData.confirm') }} </el-button> <el-button @click="dialogFormVisibleb = false">{{ $t('basicData.cancel') }}</el-button> </div> </template> -</el-dialog> + </el-dialog> <el-dialog v-model="dialogFormVisiblec" top="21vh" width="40%"> <div style="margin-left: 50px;margin-top: 10px;margin-bottom: 10px;"> <el-form size="mini" label-width="100px"> @@ -403,7 +457,7 @@ </div> <template #footer> <div id="dialog-footer"> - <el-button type="primary" @click="handleConfirm"> + <el-button type="primary" @click="handleConfirmb"> {{ $t('reportWork.sure') }} </el-button> <el-button @click="dialogFormVisiblec = false">{{ $t('reportWork.cancel') }}</el-button> -- Gitblit v1.8.0