zhoushihao
2024-05-21 b644727afb18a3035c91443cd381494e5ed60121
UI-Project/src/views/Returns/returns.vue
@@ -14,6 +14,7 @@
const adda = ref(false)
const flake = ref(false)
const flakea = ref(false)
const state = reactive({updateKey: 0})
// const value = ref('')
import request from "@/utils/request"
const ida = ref(null); 
@@ -244,8 +245,9 @@
    if (response.code == 200) {
      // 绑定成功,处理逻辑
      ElMessage.success(response.message);
      window.location.reload()
      // window.location.reload()
      add.value = false;
     tableDataa.value = response.data;
      window.localStorage.setItem('workstationId', response.data.workstationId)
      let workstationId = window.localStorage.getItem('workstationId')
      if (workstationId == '1') {
@@ -277,8 +279,9 @@
    if (response.code == 200) {
      // 绑定成功,处理逻辑
      ElMessage.success(response.message);
      window.location.reload()
      // window.location.reload()
      add.value = false;
     tableDataa.value = response.data;
      window.localStorage.setItem('workstationId', response.data.workstationId)
      let workstationId = window.localStorage.getItem('workstationId')
      if (workstationId == '1') {
@@ -320,6 +323,7 @@
      // 绑定成功,处理逻辑
      ElMessage.success(response.message);
      adda.value = false;
     tableDataa.value = response.data;
      window.localStorage.setItem('workstationId', response.data.workstationId)
      let workstationId = window.localStorage.getItem('workstationId')
      if (workstationId == '1') {
@@ -345,7 +349,7 @@
    if (response.code == 200) {
      // 绑定成功,处理逻辑
      ElMessage.success(response.message);
      window.location.reload()
      // window.location.reload()
      dialogFormVisible.value = false;
    } else {
      // 请求失败,显示错误消息
@@ -367,8 +371,10 @@
    if (response.code == 200) {
      // 绑定成功,处理逻辑
      ElMessage.success(response.message);
      window.location.reload()
      // window.location.reload()
      blind.value = false;
      tableData.splice(0, tableData.length, ...response.data);
    } else {
      // 请求失败,显示错误消息
      ElMessage.error(response.msg);
@@ -379,36 +385,6 @@
    console.error(error);
  }
}
// const handle = async () => {
//   try  {
//   let engineeringId = window.localStorage.getItem('engineeringId')
// console.log(engineeringId);
// if (engineeringId !== '') {
//   const response = await request.post('/loadGlass/engineering/engineering/changeTask', {
//       engineeringId: engineerId.va,
//       state: 1,
//     })
//     if (response.code == 200) {
//       // 绑定成功,处理逻辑
//       ElMessage.success(response.message);
//       blind.value = false;
//     } else {
//       // 请求失败,显示错误消息
//       ElMessage.error(response.msg);
//     }
//   }
//     else  {
//       ElMessage({
//         type: 'info',
//         message: '工程号不能为空!',
//       })
//     }
// }
// catch (error) {
//     // 处理错误
//     console.error(error);
//   }
// }
// 暂停
const handlea = async () => {
  try  {
@@ -422,8 +398,11 @@
    if (response.code == 200) {
      // 绑定成功,处理逻辑
      ElMessage.success(response.message);
      window.location.reload()
      // window.location.reload()
      blinda.value = false;
      // tableData.value = response.data
      // tableData.value = [];
      state.updateKey ++
    } else {
      // 请求失败,显示错误消息
      ElMessage.error(response.msg);
@@ -454,9 +433,10 @@
    if (response.code == 200) {
      // 绑定成功,处理逻辑
      ElMessage.success(response.message);
      window.location.reload()
      // window.location.reload()
      blindb.value = false;
    } else {
      state.updateKey ++
      // 请求失败,显示错误消息
      ElMessage.error(response.msg);
    }
@@ -474,11 +454,12 @@
  }
}
onMounted(fetchTableData);
function getStatusText(state: number) {
  switch (state) {
function getStatusText(state: number) {
  switch (state) {
    case 0:  
      return '等待中';  
    case 1:  
      return '上片中';
    case 2:  
      return '上片中';  
    case 100:  
@@ -596,7 +577,7 @@
    <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;">
      <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;" :key="state.updateKey">
    <el-table
    height="150"
     ref="table"