wangfei
2024-11-08 3c4b340b58d0d0bdbc3db74b5721586dd964f86c
义乌上片后端接口及前端页面样式与调用
14个文件已修改
1693 ■■■■■ 已修改文件
UI-Project/config.js 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UI-Project/src/lang/zh.js 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UI-Project/src/utils/constants.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UI-Project/src/views/GlassStorage/rawfilmstorage.vue 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UI-Project/src/views/Returns/returns.vue 417 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UI-Project/src/views/Returns/upreturns.vue 559 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UI-Project/src/views/Returns/upreturns2.vue 601 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/common/servicebase/src/main/java/com/mes/engineering/entity/Engineering.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/common/springsecurity/src/main/java/com/mes/userinfo/service/impl/SysUserServiceImpl.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/gateway/src/main/resources/application.yml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/engineering/controller/EngineeringController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/engineering/entity/Engineering.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/engineering/service/EngineeringService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/engineering/service/impl/EngineeringServiceImpl.java 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UI-Project/config.js
@@ -1,10 +1,10 @@
export default {
//  serverUrl: "10.153.19.150:88/api",
    serverUrl: "10.153.19.150:88/api",
//  serverUrl: "192.168.1.199:88/api",
 serverUrl: "127.0.0.1:88/api",
  // serverUrl2: "10.153.19.150:88"
  // serverUrl2: "192.168.1.199:88"
    serverUrl2: "127.0.0.1:88"
//  serverUrl: "127.0.0.1:88/api",
    serverUrl2: "10.153.19.150:88"
    // serverUrl2: "192.168.1.199:88"
    // serverUrl2: "127.0.0.1:88"
  //serverUrl:"res.abeim.cn"
    //serverUrl:"res.abeim.cn"
}
UI-Project/src/lang/zh.js
@@ -615,23 +615,29 @@
          station :'工位',
      },
      Mounting:{
          previewproject :'选择预览工程',
          loadinglinea :'上片线',
          loadingline :'上片线:',
          inloadingline :'请选择上片线',
          oneloadingline :'一号上片线',
          twoloadingline :'二号上片线',
          waiting :'等待中',
          setparameters :'设置参数',
          project :'工程号',
          projecta :'工程号:',
          width :'原片宽',
          height :'原片高',
          thickness :'原片厚',
          projectnumber :'工程原片序号',
          state :'状态',
          createtime :'创建时间',
          all :'全选',
          previewproject: '选择预览工程',
          loadinglinea: '上片线',
          loadingline: '上片线:',
          inloadingline: '请选择上片线',
          oneloadingline: '一号上片线',
          twoloadingline: '二号上片线',
          waiting: '等待中',
          pass: '通过',
          setparameters: '设置参数',
          project: '工程号',
          projecta: '工程号:',
          width: '原片宽',
          height: '原片高',
          thickness: '原片厚',
          projectnumber: '工程原片序号',
          state: '状态',
          createtime: '创建时间',
          all: '全选',
          removalmethod: '请选择除膜方式',
          removalmethoda: '除膜方式:',
          noremoval: '不除膜',
          coarselyground: '粗磨',
          finegrinding: '精磨',
      }
  }
UI-Project/src/utils/constants.js
@@ -1,4 +1,4 @@
//  export const WebSocketHost = "192.168.1.199";
// export const WebSocketHost = "10.153.19.150";
export const WebSocketHost = "127.0.0.1";
export const WebSocketHost = "10.153.19.150";
// export const WebSocketHost = "127.0.0.1";
export const host = "88";
UI-Project/src/views/GlassStorage/rawfilmstorage.vue
@@ -1,18 +1,16 @@
<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)
@@ -59,7 +57,7 @@
          });
onMounted(() => {
  // closeWebSocket();
  debugger
  // debugger  // 断点
  // console.log("--------------webSocket")
    socket = initializeWebSocket(socketUrl, handleMessage);
});
UI-Project/src/views/Returns/returns.vue
@@ -1,12 +1,14 @@
<script lang="ts" setup>
import {Search} from "@element-plus/icons-vue";
import {reactive} from "vue";
import {onBeforeUnmount, onMounted, onUnmounted, reactive, ref} from "vue";
import {useRouter} from "vue-router"
import {ElMessage} from 'element-plus'
import {useI18n} from 'vue-i18n'
import {host, WebSocketHost} from '@/utils/constants'
import request from "@/utils/request"
import {closeWebSocket, initializeWebSocket} from '@/utils/WebSocketService';
const router = useRouter()
import type { TableColumnCtx } from 'element-plus'
import { ElMessage, ElMessageBox } from 'element-plus'
import { useI18n } from 'vue-i18n'
const { t } = useI18n()
const {t} = useI18n()
const dialogFormVisible = ref(false)
const blind = ref(false)
const blinda = ref(false)
@@ -30,48 +32,39 @@
const number = ref('');
const canSelectProject = ref(true);
const canStartLoading = ref(false);
import { WebSocketHost ,host} from '@/utils/constants'
import request from "@/utils/request"
const ida = ref(null);
import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService';
import { ref, onMounted, onUnmounted, onBeforeUnmount } from "vue";
const selectedProjectNo = ref(''); // 当前选中的工程号
const selectedProjectNoa = ref(''); // 当前选中的工程号
const selectedValue = ref(''); // 当前选中的宽
const selectedValuea = ref('');
const ida = ref(null);
const selectedProjectNo = ref('');
const selectedProjectNoa = ref('');
const selectedValue = ref('');
const selectedValuea = ref('');
const selectedValueb = ref('');
const selectedValuec = ref('');
// const upstatus = ref('上片机手动状态:'); // 假设这个用于显示自动/手动状态
const selectedValuec = ref('');
const upstatus = ref(t('basicData.machineaa'));
const cuttingMachine = ref(''); // 假设这个用于存储后端返回的状态值(0或1)
const cuttingMachine = ref('');
const cuttingMachineStatusColor = ref('#911005'); // 用于动态设置i标签的背景色 
const inKageWord = ref(0); // 用于存储要传递给接口的inKageWord值 
const options = ref<any[]>([]); // 下拉选项列表
const selectOptions = ref<Array<any>>([]); // 下拉选选项数组
const selectOptionsa = ref<Array<any>>([]); // 下拉选选项数组
const selectOptionsb = ref<Array<any>>([]); // 下拉选选项数组
const selectOptionsc = ref<Array<any>>([]); // 下拉选选项数组
  const tableDataa = ref([])
  const tableData = reactive([]);
  const fetchTableData = async () => {
const options = ref<any[]>([]);
const selectOptions = ref<Array<any>>([]);
const selectOptionsa = ref<Array<any>>([]);
const selectOptionsb = ref<Array<any>>([]);
const selectOptionsc = ref<Array<any>>([]);
const tableDataa = ref([])
const tableData = reactive([]);
const fetchTableData = async () => {
  try {
    const response = await request.get("/loadGlass/up-patten-usage/prioritylist");
    // 检查响应状态
    if (response.code === 200) {
      // 更新表格数据
      console.log('成功获取表格数据:', response.data);
      tableData.splice(0, tableData.length, ...response.data);
      // window.localStorage.setItem('engineeringId', response.data[0].engineeringId)
      // 获取唯一值
      const uniqueWidths = new Set(response.data.map(item => item.width));
      const uniqueHeights = new Set(response.data.map(item => item.height));
      const uniqueFilmsIds = new Set(response.data.map(item => item.filmsId));
      const uniqueWidths = new Set(response.data.map(item => item.width));
      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, // 假设这是你想要作为value的属性
      label: width, // 假设这是你想要显示的label
    }));
      selectOptions.value = Array.from(uniqueWidths).map(width => ({
        value: width,
        label: width,
      }));
      selectOptionsa.value = Array.from(uniqueHeights).map(height => ({ 
      value: height, 
      label: height, 
@@ -93,12 +86,12 @@
  }
};
const handlezhiban = () => {
  dialoglea.value = true; // 打开绑定架子对话框
  dialoglea.value = true;
  fetchFlowCardId(); 
};
const selectproject = () => {
  dialogFormVisible.value = true;
  selectgong();
  dialogFormVisible.value = true;
  selectgong();
};
// 值班信息
const fetchFlowCardId = async () => {
@@ -110,14 +103,11 @@
    if (response.code == 200) {
      ElMessage.success(response.message);
      tableDatax.value = response.data;
      console.log(tableDatax.value);
      console
    } else {
      ElMessage.error(response.message);
    }
}
catch (error) {
    // 处理错误
    console.error(error);
  }
}
@@ -131,15 +121,15 @@
  }
};
onMounted(() => {
  list('');
  list('');
  fetchOptions('');
  socket = initializeWebSocket(socketUrl, handleMessage);
});
  onUnmounted(() => {
    if (socket) {
onUnmounted(() => {
  if (socket) {
    closeWebSocket(socket);
    }
    });
  }
});
const list = async () => {  
  try {  
    const response = await request.get('/loadGlass/LoadGlass/list');  
@@ -166,30 +156,6 @@
    console.error('Error fetching options:', error);  
  }  
}; 
// 假设这是您的响应处理函数
// request.get("/loadGlass/LoadGlass/list").then((res) => {
//       if (res.code == 200) {
//           tableDataa.value = res.data
//           if (tableDataa.value.length === 4) {
//           if (tableDataa.value[0].patternHeight > 0) {
//           flake.value = true;
//           }
//          if (tableDataa.value[1].patternHeight > 0) {
//           flakea.value = true;
//           }
//          if (tableDataa.value[2].patternHeight > 0) {
//           flakeb.value = true;
//           }
//          if (tableDataa.value[3].patternHeight > 0) {
//           flakec.value = true;
//           }
//            }
//           } else {
//           ElMessage.warning(res.message)
//           // router.push("/login")
//           }
//           });
//定义接收加载表头下拉数据
const titleSelectJson = ref({
  processType: [],
})
@@ -198,7 +164,6 @@
})
let socket = null;
const socketUrl = `ws://${WebSocketHost}:${host}/api/loadGlass/api/talk/loadGlass`;
// 定义消息处理函数,更新 receivedData 变量
const handleMessage = (data) => {
  if(data.prioritylist!=null){
  tableData.splice(0, tableData.length, ...data.prioritylist[0]);
@@ -228,15 +193,11 @@
const requestData = {  
  state: 100  
};  
const selectgong = async (queryString: string) => {
  try  {
    const response = await request.post('/loadGlass/optimizeProject/listByState',{
      ...requestData,
      query: queryString
      ...requestData,
      projectNo: queryString
    })
    if (response.code == 200) {
      titleSelectJson.value.processType = response.data;
@@ -245,23 +206,20 @@
    }
}
catch (error) {
    // 处理错误
    console.error(error);
  }
}
const fetchOptions = async (queryString: string) => {
  try {
    // 发送请求到后端接口
    const response = await request.post('/loadGlass/optimizeProject/listByState', {
      ...requestData,
      query: queryString // 将查询字符串作为参数传递
    });
    if (response.code == 200) {
    // titleSelectJson.value.processType = response.data;
    console.log(response.data);
    } else {
      ElMessage.warning(response.data);
const fetchOptions = async (queryString: string) => {
  try {
    const response = await request.post('/loadGlass/optimizeProject/listByState', {
      ...requestData,
      query: queryString
    });
    if (response.code == 200) {
      // titleSelectJson.value.processType = response.data;
      console.log(response.data);
    } else {
      ElMessage.warning(response.data);
    }  
  } catch (error) {  
    console.error('Error fetching options:', error);  
@@ -271,8 +229,8 @@
const handleInputChange = async (value: string) => {  
  if (value) {  
    await fetchOptions(value);  
  } else {
    options.value = []; // 清空选项列表
  } else {
    options.value = [];
  }  
};  
  // 处理用户输入变化的方法  
@@ -288,38 +246,27 @@
});
// 添加
const handleBindRack = (row) => {
  workstationId.value = row.workstationId; // 假设rackNumber是架号字段的属性名
  workstationId.value = row.workstationId;
  ida.value = row.id;
  add.value = true; // 打开绑定架子对话框
  add.value = true;
};
// 添加
    const handleConfirm = async () => {
      // console.log('id.value:', id.value);
  if ((ida.value === 2 || ida.value === 4) && (parseInt(selectedValuea.value, 10) >= 2700 )) {
const handleConfirm = async () => {
  if ((ida.value === 2 || ida.value === 4) && (parseInt(selectedValuea.value, 10) >= 2700)) {
    try {
    const response = await request.post('/loadGlass/LoadGlass/updateGlassMessage', {
      id: workstationId.value,
      workstationId: workstationId.value,
      patternHeight: selectedValuea.value,
      patternWidth: selectedValue.value,
      filmsId: selectedValueb.value,
      patternThickness: selectedValuec.value,
      number: number.value
    });
      // window.localStorage.setItem('workstationId', workstationId.value)
      // window.localStorage.setItem('patternHeight', selectedValuea.value)
      // window.localStorage.setItem('patternWidth', selectedValue.value)
      // window.localStorage.setItem('number', number.value)
      const response = await request.post('/loadGlass/LoadGlass/updateGlassMessage', {
        id: workstationId.value,
        workstationId: workstationId.value,
        patternHeight: selectedValuea.value,
        patternWidth: selectedValue.value,
        filmsId: selectedValueb.value,
        patternThickness: selectedValuec.value,
        number: number.value
      });
    if (response.code == 200) {
      // 绑定成功,处理逻辑
      ElMessage.success(response.message);
      // window.location.reload()
      add.value = false;
     tableDataa.value = response.data;
      // let workstationId = window.localStorage.getItem('workstationId')
      // let patternHeight = window.localStorage.getItem('patternHeight')
      // let patternWidth = window.localStorage.getItem('patternWidth')
      // let number = window.localStorage.getItem('number')
      if (selectedValuea.value !== '0' && selectedValue.value !== '0' && number.value !== '0' && workstationId.value === '1') {
      flake.value = true
    } else if (selectedValuea.value !== '0' && selectedValue.value !== '0' && number.value !== '0' && workstationId.value === '2'){
@@ -329,23 +276,13 @@
    }else if (selectedValuea.value !== '0' && selectedValue.value !== '0' && number.value !== '0' && workstationId.value === '4'){
      flakec.value = true
    }
    //   if (patternHeight !== '0' && patternWidth !== '0' && number !== '0' && workstationId === '1') {
    //   flake.value = true
    // } else if (patternHeight !== '0' && patternWidth !== '0' && number !== '0' && workstationId === '2'){
    //   flakea.value = true
    // }else if (patternHeight !== '0' && patternWidth !== '0' && number !== '0' && workstationId === '3'){
    //   flakeb.value = true
    // }else if (patternHeight !== '0' && patternWidth !== '0' && number !== '0' && workstationId === '4'){
    //   flakec.value = true
    // }
      selectedValuea.value = '';
      selectedValue.value = '';
      selectedValueb.value = '';
      selectedValuec.value = '';
      number.value = '';
        list()
      list()
    } else {
      // 请求失败,显示错误消息
      ElMessage.error(response.message);
    }
  } catch (error) {  
@@ -364,9 +301,7 @@
      number: number.value
    }); 
    if (response.code == 200) {
      // 绑定成功,处理逻辑
      ElMessage.success(response.message);
      // window.location.reload()
      add.value = false;
     tableDataa.value = response.data;
      if (selectedValuea.value !== '0' && selectedValue.value !== '0' && number.value !== '0' && workstationId.value === '1') {
@@ -411,28 +346,23 @@
      number: 0
    });
    if (response.code == 200) {
      // 绑定成功,处理逻辑
      ElMessage.success(response.message);
      adda.value = false;
     tableDataa.value = response.data;
      // window.localStorage.setItem('workstationId', response.data.workstationId)
      // let workstationId = window.localStorage.getItem('workstationId')
      tableDataa.value = response.data;
      if (workstationId.value == '1') {
      flake.value = false
    } else if (workstationId.value == '2'){
      flakea.value = false
    }else if (workstationId.value == '3'){
      flakeb.value = false
    }else if (workstationId.value == '4'){
      flakec.value = false
    }
        list()
      } else {
      // 请求失败,显示错误消息
        flake.value = false
      } else if (workstationId.value == '2') {
        flakea.value = false
      } else if (workstationId.value == '3') {
        flakeb.value = false
      } else if (workstationId.value == '4') {
        flakec.value = false
      }
      list()
    } else {
      ElMessage.error(response.message);
    }
  } catch (error) {
    // 处理错误
    console.error(error);
  }
};
@@ -444,9 +374,7 @@
    })
      window.localStorage.setItem('engineeringId', selectedProjectNo.value)
    if (response.code == 200) {
      // 绑定成功,处理逻辑
      ElMessage.success(response.message);
      // window.location.reload()
      dialogFormVisible.value = false;
      tableData.splice(0, tableData.length, ...response.data);
      selectedProjectNo.value = ''
@@ -473,13 +401,10 @@
      label: thickness,  
    })); 
    } else {
      // 请求失败,显示错误消息
      ElMessage.error(response.message);
      // ElMessage.error(response.msg);
    }
}
catch (error) {
    // 处理错误
    console.error(error);
  }
}
@@ -493,18 +418,14 @@
    state: 1,
    })
    if (response.code == 200) {
      // 绑定成功,处理逻辑
      ElMessage.success(response.message);
      // window.location.reload()
      blind.value = false;
      selectedProjectNoa.value = '';
    } else {
      // 请求失败,显示错误消息
      ElMessage.error(response.message);
    }
}
catch (error) {
    // 处理错误
    console.error(error);
  }
    } else if (markingMachineStatus.value === '#911005' || cuttingMachineStatus.value === '#911005') {  
@@ -514,21 +435,20 @@
}
// 暂停
const handlea = async () => {
  try  {
  let engineeringId = window.localStorage.getItem('engineeringId')
console.log(engineeringId);
if (engineeringId !== '') {
  const response = await request.post('/loadGlass/engineering/engineering/pauseTask', {
      engineeringId: engineeringId,
      state: 0,
    })
    if (response.code == 200) {
      ElMessage.success(response.message);
      blinda.value = false;
      // tableData.splice([]);
    } else {
      // 请求失败,显示错误消息
      ElMessage.error(response.message);
  try {
    let engineeringId = window.localStorage.getItem('engineeringId')
    console.log(engineeringId);
    if (engineeringId !== '') {
      const response = await request.post('/loadGlass/engineering/engineering/pauseTask', {
        engineeringId: engineeringId,
        state: 0,
      })
      if (response.code == 200) {
        ElMessage.success(response.message);
        blinda.value = false;
        // tableData.splice([]);
      } else {
        ElMessage.error(response.message);
    }
  }
    else  {
@@ -539,7 +459,6 @@
    }
}
catch (error) {
    // 处理错误
    console.error(error);
  }
}
@@ -554,13 +473,9 @@
      state: 0,
    })
    if (response.code == 200) {
      // 绑定成功,处理逻辑
      ElMessage.success(response.message);
      // window.location.reload()
      blindb.value = false;
      tableData.splice([]);
      // 请求失败,显示错误消息
      ElMessage.error(response.message);
    }
  }
@@ -572,7 +487,6 @@
    }
}
catch (error) {
    // 处理错误
    console.error(error);
  }
}
@@ -603,7 +517,7 @@
}  
// 开始上片
const handleBind = (row) => {
  blind.value = true; // 打开绑定架子对话框
  blind.value = true;
};
// 暂停
const handleBinda = (row) => {
@@ -613,11 +527,10 @@
const handleBindb = (row) => {
  blindb.value = true; 
};
// 删除
const handleBindRacka = (row) => {
  workstationId.value = row.workstationId;
  adda.value = true;
  adda.value = true;
};
// 定义一个响应式引用,用于存储颜色状态  
const markingMachineStatus = ref('#911005');  
@@ -638,76 +551,34 @@
  const newState = row.state === 100 ? 0 : 100;  
  try {  
    // 发送请求到后端更新状态  
    const response = await request.post('/loadGlass/up-patten-usage/updateGlassState', { id: row.id, state: newState });
    if (response.code === 200) {
      ElMessage.success(response.message);
      row.state = newState;
    } else {
      ElMessage.error(response.message);
    }
  } catch (error) {
    const response = await request.post('/loadGlass/up-patten-usage/updateGlassState', { id: row.id, state: newState });
    if (response.code === 200) {
      ElMessage.success(response.message);
      row.state = newState;
    } else {
      ElMessage.error(response.message);
    }
  } catch (error) {
    // 处理请求错误  
    ElMessage.error(t('basicData.glassnull'));
  }
};
// 上片机联机状态
// const wsUrl = `ws://${WebSocketHost}:${host}/api/loadGlass/api/talk/loadGlass`;
// const ws = new WebSocket(wsUrl);
// ws.onopen = () => {
//   console.log('WebSocket连接已打开');
// };
// // 监听WebSocket的错误事件
// ws.onerror = (error) => {
//   console.error('WebSocket发生错误:', error);
// };
// // 监听WebSocket的关闭事件
// ws.onclose = (event) => {
//   if (event.wasClean) {
//     console.log('WebSocket连接已正常关闭');
//   } else {
//     console.error('WebSocket连接异常关闭');
//   }
// };
// // 监听WebSocket的消息事件
// ws.onmessage = (event) => {
//   try {
//     const data = JSON.parse(event.data.replace('<END>', '')); // 解析消息为JSON
//     if (data && Array.isArray(data.InkageStatus) && data.InkageStatus.length > 0) {
// if(data.InkageStatus!=null){
//       const status = data.InkageStatus[0];
//       cuttingMachine.value = status;
//             upstatus.value = status === '1' ? t('basicData.machine') : t('basicData.machineaa');
//       cuttingMachineStatusColor.value = status === '1' ? 'green' : '#911005';
//       inKageWord.value = status === '1' ? 0 : 1;
// }
//     } else {
//       // 处理错误情况或无效数据
//       // console.error('接收到的数据无效', data);
//     }
//   } catch (error) {
//     // console.error('解析WebSocket消息时发生错误', error);
//   }
// };
const confirmCutting = async () => {
  try {
    const response = await request.post('/loadGlass/LoadGlass/updateMesInkageLoad',
      inKageWord.value
  );
    if (response.code == 200) {
      const status = response.data.status;
    ElMessage.error(t('basicData.glassnull'));
  }
};
const confirmCutting = async () => {
  try {
    const response = await request.post('/loadGlass/LoadGlass/updateMesInkageLoad',
        inKageWord.value
    );
    if (response.code == 200) {
      const status = response.data.status;
      upstatus.value = status === '1' ? t('basicData.machine') : t('basicData.machineaa');
      cuttingMachineStatusColor.value = status === '1' ? 'green' : '#911005';
      // 显示成功消息
      ElMessage.success(response.message);
    } else {
      ElMessage.error(response.message || '请求失败');
    }
  } catch (error) {
    // 处理错误
    console.error('请求时发生错误', error);
    ElMessage.error('请求时发生错误');
      cuttingMachineStatusColor.value = status === '1' ? 'green' : '#911005';
      ElMessage.success(response.message);
    } else {
      ElMessage.error(response.message || '请求失败');
    }
  } catch (error) {
    console.error('请求时发生错误', error);
    ElMessage.error('请求时发生错误');
  }  
};
</script>
@@ -730,14 +601,13 @@
    <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="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
    height="350"
     ref="table"
     :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"
      :data="tableData"
        height="350"
        ref="table"
        :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"
        :data="tableData"
    >
      <el-table-column prop="layoutSequence" :label="$t('basicData.layoutSequence')" width="100" align="center"/>
      <el-table-column prop="engineeringId" :label="$t('basicData.projectnumber')" width="200" align="center"/>
@@ -790,7 +660,6 @@
      </div>
    </template>
  </el-dialog>
<el-dialog v-model="dialoglea" top="15vh" width="70%" :title="$t('searchOrder.dutyinformation')">
    <el-table  ref="table" style="margin-top: 20px;height: 300px;"
        :data="tableDatax" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}">
@@ -860,7 +729,6 @@
        </el-table-column>
        </el-table>
    </div>
  <el-dialog v-model="add" top="23vh" width="45%" :title="$t('basicData.addglass')" >
    <div style="margin-left: -50px;margin-top: 10px;margin-bottom: 10px;">
            <el-form  size="mini" label-width="150px">
@@ -991,23 +859,23 @@
  <el-dialog v-model="dialogFormVisible" top="24vh" width="30%" :title="$t('basicData.project')" >
    <div style="margin-left: 50px;margin-bottom: 10px;">
      <el-form-item :label="$t('basicData.projectnumber')" :required="true">
        <el-select
           v-model="selectedProjectNo"
           filterable
           clearable
           :placeholder="$t('basicData.plselectproject')"
           style="width: 220px"
           @input="handleInputChange"
         >
      <el-option
         v-for="item in titleSelectJson['processType']"
         :key="item.id"
         :label="item.projectNo"
         :value="item.projectNo"
      />
    </el-select>
              </el-form-item>
          </div>
        <el-select
            v-model="selectedProjectNo"
            filterable
            clearable
            :placeholder="$t('basicData.plselectproject')"
            style="width: 220px"
            @input="handleInputChange"
        >
          <el-option
              v-for="item in titleSelectJson['processType']"
              :key="item.id"
              :label="item.projectNo"
              :value="item.projectNo"
          />
        </el-select>
      </el-form-item>
    </div>
    <template #footer>
      <div id="dialog-footer">
        <el-button type="primary" @click="handleup">
@@ -1018,9 +886,7 @@
    </template>
  </el-dialog>
</template>
<style scoped>
#dt { display:block; float:left;line-height: 20px;margin-left: 100px;}
#dta { display:block; float:left;line-height: 20px;margin-left: 80%;}
#dialog-footer{
@@ -1075,5 +941,4 @@
  margin-top: -45px;
  margin-left: 703px;
}
</style>
UI-Project/src/views/Returns/upreturns.vue
@@ -10,156 +10,229 @@
const router = useRouter()
const {t} = useI18n()
const selectValuesa = reactive([]);
const selectedProjectNo = ref(''); // 当前选中的工程号
const loadingline = ref(''); // 当前选中的上片线
const selectedProjectNo = ref('');
const stationCell = ref('1');
const filmRemove = ref('');
const dialogFormVisible = ref(false)
const blind = ref(false)
const blinda = ref(false)
const blindb = ref(false)
const add = ref(false)
const adda = ref(false)
const dialoglea = ref(false)
const tableDatax = ref([])
const user = ref('');
const projectNo = ref('');
const workstationId = ref('');
const id = ref('');
const patternHeight = ref('');
const patternWidth = ref('');
const filmsId = ref('');
const patternThickness = ref('');
const number = ref('');
const canSelectProject = ref(true);
const canStartLoading = ref(false);
const selectedValue = ref(''); // 当前选中的宽
const selectedValuea = ref('');
const selectedValueb = ref('');
const selectedValuec = ref('');
// const upstatus = ref('上片机手动状态:'); // 假设这个用于显示自动/手动状态
const upstatus = ref(t('basicData.machineaa'));
const cuttingMachine = ref(''); // 假设这个用于存储后端返回的状态值(0或1)
const cuttingMachineStatusColor = ref('#911005'); // 用于动态设置i标签的背景色 
const inKageWord = ref(0); // 用于存储要传递给接口的inKageWord值
const options = ref<any[]>([]); // 下拉选项列表
const ida = ref(null);
const selectOptions = ref<Array<any>>([]); // 下拉选选项数组
const selectOptionsa = ref<Array<any>>([]); // 下拉选选项数组
const selectOptionsb = ref<Array<any>>([]); // 下拉选选项数组
const selectOptionsc = ref<Array<any>>([]); // 下拉选选项数组
  const tableDataa = ref([])
  const tableData = reactive([]);
const tableDataa = ref<any[]>([]);
const tableDatab = ref<any[]>([]);
const tableData = ref([])
// const tableData = reactive([]);
const titleSelectJson = ref({
  engineerId: [],
})
const handlezhiban = () => {
  dialoglea.value = true; // 打开绑定架子对话框
  dialoglea.value = true;
  fetchFlowCardId();
};
const selectproject = () => {
  dialogFormVisible.value = true;
  selectgong();
};
const markingMachineStatus = ref('#911005');
const cuttingMachineStatus = ref('#911005');
const confirmMarkingMachine = () => {
  markingMachineStatus.value = 'green';
};
const confirmCuttingMachine = () => {
  cuttingMachineStatus.value = 'green';
};
onMounted(() => {
  socket = initializeWebSocket(socketUrl, handleMessage);
});
const handleMessage = (data) => {
}
  onUnmounted(() => {
    if (socket) {
onUnmounted(() => {
  if (socket) {
    closeWebSocket(socket);
  }
});
const fetchTableData = async () => {
  try {
    const response = await request.get("/loadGlass/up-patten-usage/prioritylist");
    if (response.code === 200) {
      tableData.splice(0, tableData.length, ...response.data);
      ElMessage.error(response.message);
    }
    });
//定义接收加载表头下拉数据
const titleSelectJson = ref({
  engineerId: [],
})
  } catch (error) {
    // 处理请求失败的情况
    // ElMessage.error('获取表格数据失败,请重试');
  }
};
let socket = null;
const socketUrl = `ws://${WebSocketHost}:${host}/api/loadGlass/api/talk/uploadGlass`;
// 定义消息处理函数,更新 receivedData 变量
const handleMessage = (data: any) => {
  tableDataa.value = data.list[0].slice(0, 2);
  tableDatab.value = data.list[0].slice(2, 4);
};
onBeforeUnmount(() => {
  closeWebSocket();
});
const selectgong = async () => {
const requestData = {
  state: 100
};
const selectgong = async (queryString: string) => {
  try {
    const response = await request.post('/loadGlass/engineering/engineering/selectTask')
    const response = await request.post('/loadGlass/optimizeProject/listByState', {
      ...requestData,
      query: queryString
    });
    if (response.code == 200) {
      titleSelectJson.value.engineerId = response.data;
    } else {
      ElMessage.error(response.message);
    }
  } catch (error) {
    // 处理错误
    console.error(error);
  }
};
//选择工程预览确认
const handlesure = async () => {
  try {
    const response = await request.post('/loadGlass/up-patten-usage/selectUpPattenUsage', {
      stationCell: 1,
      // engineerId: 'P24101602',
      engineerId: selectedProjectNo.value,
      filmRemove: filmRemove.value,
    })
    window.localStorage.setItem('engineeringId', selectedProjectNo.value)
    window.localStorage.setItem('filmRemove', filmRemove.value)
    if (response.code == 200) {
      ElMessage.success(response.message);
      tableData.value = response.data;
      dialogFormVisible.value = false;
      selectedProjectNo.value = ''
      filmRemove.value = ''
    } else {
      ElMessage.error(response.message);
    }
  } catch (error) {
    console.error(error);
  }
}
// 添加
const handleBindRack = (row) => {
  workstationId.value = row.workstationId; // 假设rackNumber是架号字段的属性名
  ida.value = row.id;
  add.value = true; // 打开绑定架子对话框
// 开始上片
const handleon = async () => {
  let filmRemove = window.localStorage.getItem('filmRemove')
  let engineeringId = window.localStorage.getItem('engineeringId')
  if (markingMachineStatus.value === 'green' && cuttingMachineStatus.value === 'green') {
    try {
      const response = await request.post('/loadGlass/engineering/engineering/changeTask', {
        stationCell: 1,
        filmRemove: filmRemove,
        // engineerId: 'P24101602',
        engineerId: engineeringId,
        state: 1,
      })
      if (response.code == 200) {
        ElMessage.success(response.message);
        blind.value = false;
      } else {
        ElMessage.error(response.message);
      }
    } catch (error) {
      console.error(error);
    }
  } else if (markingMachineStatus.value === '#911005' || cuttingMachineStatus.value === '#911005') {
    // 提示用户打标机未就绪
    ElMessage.warning(t('basicData.pausea'));
  }
}
// 暂停
const handleup = async () => {
  try {
    let engineeringId = window.localStorage.getItem('engineeringId')
    console.log(engineeringId);
    if (engineeringId !== '') {
      const response = await request.post('/loadGlass/engineering/engineering/pauseTask', {
        stationCell: 1,
        // engineerId: 'P24101602',
        engineeringId: engineeringId,
        state: 0,
      })
      if (response.code == 200) {
        ElMessage.success(response.message);
        blinda.value = false;
      } else {
        ElMessage.error(response.message);
      }
    } else {
      ElMessage({
        type: 'info',
        message: t('basicData.infonull'),
      })
    }
  } catch (error) {
    console.error(error);
  }
}
// 查询数据
const selectReportData = async () => {
  let stateList = []
  if (selectValuesa[1] != null && selectValuesa[1] != 'undefined') {
    if (selectValuesa[1] != "") {
      stateList = [selectValuesa[1]];
    }
  }
  const response = await request.post("/cacheVerticalGlass/damage/selectDamage", {
    taskState: stateList,
    taskType: 1
  })
  if (response.code === 200) {
    tableData.value = response.data;
    ElMessage.success(response.message);
  } else {
    ElMessage.error(response.message);
  }
};
function getStatusText(state: number) {
  switch (state) {
    case 0:
      return t('basicData.waiting');
    case 1:
      return t('basicData.up');
    case 2:
      return t('basicData.up');
    case 100:
    return t('basicData.finish');
  }
}
function getStatusType(state: number) {
  switch (state) {
    case 0:
      return 'warning';
    case 1:
      return 'primary';
    case 2:
      return 'primary';
    case 100:
      return 'success';
  }
}
// 值班信息
const fetchFlowCardId = async () => {
  try {
    const response = await request.post('/loadGlass/work_assignment/selectWorkAssignment', {
      line: 2001,
      workingProcedure: '冷加工'
    })
    if (response.code == 200) {
      ElMessage.success(response.message);
      tableDatax.value = response.data;
    } else {
      ElMessage.error(response.message);
    }
  } catch (error) {
    console.error(error);
  }
}
onMounted(fetchTableData);
// 开始上片
const handleBind = (row) => {
  blind.value = true; // 打开绑定架子对话框
  blind.value = true;
};
// 暂停
const handleBinda = (row) => {
  blinda.value = true;
};
// 停止任务
const handleBindb = (row) => {
  blindb.value = true;
};
const toggleEnableState = async (row: any) => {
const toggleEnableState = async (row: any) => {
  // 检查 id 是否为空  
  if (!row.id) {  
    ElMessage.error(t('basicData.updatanull'));  
    return; // 如果 id 为空,则不执行后续操作  
  }  
  const newState = row.state === 100 ? 0 : 100;
  try {
    // 发送请求到后端更新状态
    const response = await request.post('/loadGlass/up-patten-usage/updateGlassState', { id: row.id, state: newState });
    if (response.code === 200) {
      ElMessage.success(response.message);
      row.state = newState;
    } else {
      ElMessage.error(response.message);
    }
  } catch (error) {
    // 处理请求错误
    ElMessage.error(t('basicData.glassnull'));
  const newState = row.state === 100 ? 0 : 100;
  try {
    const response = await request.post('/loadGlass/up-patten-usage/updateGlassState', {id: row.id, state: newState});
    if (response.code === 200) {
      ElMessage.success(response.message);
      row.state = newState;
    } else {
      ElMessage.error(response.message);
    }
  } catch (error) {
    ElMessage.error(t('basicData.glassnull'));
  }  
};
</script>
@@ -175,13 +248,13 @@
    <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 style="margin-top: 5px;margin-left: 15px;"  type="primary" @click="selectproject">{{ $t('Mounting.previewproject') }}</el-button>
    <el-button style="margin-top: 5px;margin-left: 20px;" type="success" @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="info" @click="handlezhiban">{{ $t('searchOrder.dutyinformation') }}</el-button>
    <el-select v-model="selectValuesa[1]" clearable :placeholder="$t('Mounting.loadinglinea')" style="margin-top: 5px;margin-left: 20px;" >
    <el-select disabled v-model="selectValuesa[1]" clearable :placeholder="$t('Mounting.oneloadingline')"
               style="margin-top: 5px;margin-left: 20px;">
      <el-option :label="$t('Mounting.all')" value="0"></el-option>
      <el-option :label="$t('Mounting.oneloadingline')" value="1"></el-option>
      <el-option :label="$t('Mounting.twoloadingline')" value="2"></el-option>
@@ -231,79 +304,78 @@
      </div>
    </el-card>
    <div style="display: flex;">
  <div style="width: 49%;float: left;">
    <div style="display: flex;">
        <img src="../../assets/shangpianji.png" alt="" style="max-width: 25%;max-height: 25%;margin-left: 10%;margin-top: 5%;">
        <el-table :data="tableDataa" border style="width: 75%;margin-top: 10%;margin-left: 2%;"
     :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"
        >
          <el-table-column prop="workstationId" align="center" :label="$t('basicData.station')" min-width="60" />
          <el-table-column prop="patternWidth" align="center" :label="$t('basicData.width')" min-width="80" />
          <el-table-column prop="patternHeight" align="center" :label="$t('basicData.height')" min-width="80" />
          <el-table-column prop="filmsId" align="center" :label="$t('basicData.coatingtypes')" min-width="80" />
          <el-table-column prop="number" align="center" :label="$t('basicData.quantity')" min-width="80" />
      <div style="width: 49%;float: left;margin-left: 300px;">
        <div style="display: flex;">
          <img src="../../assets/shangpianji.png" alt=""
               style="max-width: 25%;max-height: 25%;margin-left: 10%;margin-top: 5%;">
          <el-table :data="tableDataa" border style="width: 75%;margin-top: 10%;margin-left: 2%;"
                    :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"
          >
            <el-table-column prop="workstationId" align="center" :label="$t('basicData.station')" min-width="60"/>
            <el-table-column prop="patternWidth" align="center" :label="$t('basicData.width')" min-width="80"/>
            <el-table-column prop="patternHeight" align="center" :label="$t('basicData.height')" min-width="80"/>
            <el-table-column prop="filmsId" align="center" :label="$t('basicData.coatingtypes')" min-width="80"/>
            <el-table-column prop="number" align="center" :label="$t('basicData.quantity')" min-width="80"/>
        </el-table>
    </div>
  </div>
    <div style="width: 48%;float: right;">
      <div style="display: flex;">
        <img src="../../assets/shangpianji.png" alt="" style="max-width: 25%;max-height: 25%;margin-left: 10%;margin-top: 5%;">
        <el-table :data="tableDataa" border style="width: 75%;margin-top: 10%;margin-left: 2%;"
     :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"
        >
          <el-table-column prop="workstationId" align="center" :label="$t('basicData.station')" min-width="60" />
          <el-table-column prop="patternWidth" align="center" :label="$t('basicData.width')" min-width="80" />
          <el-table-column prop="patternHeight" align="center" :label="$t('basicData.height')" min-width="80" />
          <el-table-column prop="filmsId" align="center" :label="$t('basicData.coatingtypes')" min-width="80" />
          <el-table-column prop="number" align="center" :label="$t('basicData.quantity')" min-width="80" />
        </el-table>
    </div>
</div>
      <!-- <div style="width: 48%;float: right;">
        <div style="display: flex;">
          <img src="../../assets/shangpianji.png" alt="" style="max-width: 25%;max-height: 25%;margin-left: 10%;margin-top: 5%;">
          <el-table :data="tableDatab" border style="width: 75%;margin-top: 10%;margin-left: 2%;"
       :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"
          >
            <el-table-column prop="workstationId" align="center" :label="$t('basicData.station')" min-width="60" />
            <el-table-column prop="patternWidth" align="center" :label="$t('basicData.width')" min-width="80" />
            <el-table-column prop="patternHeight" align="center" :label="$t('basicData.height')" min-width="80" />
            <el-table-column prop="filmsId" align="center" :label="$t('basicData.coatingtypes')" min-width="80" />
            <el-table-column prop="number" align="center" :label="$t('basicData.quantity')" min-width="80" />
          </el-table>
      </div>
  </div> -->
</div>
  <el-dialog v-model="blind" top="30vh" width="25%" :title="$t('basicData.startfilm')">
    <template #footer>
      <div id="dialog-footer">
        <el-button type="primary" @click="handle">
        <el-button type="primary" @click="handleon">
          {{ $t('basicData.confirm') }}
        </el-button>
        <el-button @click="blind = false">{{ $t('basicData.cancel') }}</el-button>
      </div>
    </template>
  </el-dialog>
<el-dialog v-model="dialoglea" top="15vh" width="70%" :title="$t('searchOrder.dutyinformation')">
    <el-table  ref="table" style="margin-top: 20px;height: 300px;"
        :data="tableDatax" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}">
          <el-table-column prop="line" fixed align="center" :label="$t('searchOrder.line')"/>
          <el-table-column prop="workProcesses" fixed align="center" :label="$t('searchOrder.process')" />
          <el-table-column prop="teamsGroupsName" align="center" :label="$t('searchOrder.team')">
        <template #default="{ row }">
          <el-input v-model="row.teamsGroupsName" autocomplete="off" min-width="150"/>
        </template>
      </el-table-column>
          <el-table-column prop="deviceName" align="center" :label="$t('searchOrder.basic')">
            <template #default="{ row }">
          <el-input v-model="row.deviceName" autocomplete="off" min-width="150"/>
        </template>
    <el-dialog v-model="dialoglea" top="15vh" width="70%" :title="$t('searchOrder.dutyinformation')">
      <el-table ref="table" style="margin-top: 20px;height: 300px;"
                :data="tableDatax" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}">
        <el-table-column prop="line" fixed align="center" :label="$t('searchOrder.line')"/>
        <el-table-column prop="workProcesses" fixed align="center" :label="$t('searchOrder.process')"/>
        <el-table-column prop="teamsGroupsName" align="center" :label="$t('searchOrder.team')">
          <!-- <template #default="{ row }">
            <el-input v-model="row.teamsGroupsName" autocomplete="off" min-width="150"/>
          </template>   -->
        </el-table-column>
        <el-table-column prop="deviceName" align="center" :label="$t('searchOrder.basic')">
          <!-- <template #default="{ row }">
        <el-input v-model="row.deviceName" autocomplete="off" min-width="150"/>
      </template> -->
        </el-table-column>
        </el-table>
        <template #footer>
      <div id="dialog-footer">
        <el-button type="primary" @click="handleConfirm">
          {{ $t('searchOrder.add') }}
        </el-button>
        <el-button @click="dialoglea = false">{{ $t('searchOrder.cancel') }}</el-button>
        <el-button @click="dialoglea = false">{{ $t('large.close') }}</el-button>
      </div>
    </template>
</el-dialog>
  <el-dialog v-model="blinda" top="24vh" width="30%" :title="$t('basicData.whetherpause')">
    <div style="margin-left: 50px;margin-bottom: 10px;">
    <el-form-item :label="$t('Mounting.loadingline')" :required="true">
    <el-select v-model="loadingline" clearable :placeholder="$t('Mounting.inloadingline')" style="margin-left: 20px;" >
      <el-option :label="$t('Mounting.all')" value="0"></el-option>
      <el-option :label="$t('Mounting.oneloadingline')" value="1"></el-option>
      <el-option :label="$t('Mounting.twoloadingline')" value="2"></el-option>
    </el-select>
      <el-select disabled v-model="stationCell" clearable :placeholder="$t('Mounting.inloadingline')"
                 style="margin-left: 20px;">
        <el-option :label="$t('Mounting.all')" value="0"></el-option>
        <el-option :label="$t('Mounting.oneloadingline')" value="1"></el-option>
        <el-option :label="$t('Mounting.twoloadingline')" value="2"></el-option>
      </el-select>
    </el-form-item>
    </div>
    <template #footer>
@@ -315,169 +387,50 @@
      </div>
    </template>
  </el-dialog>
  <el-dialog v-model="add" top="23vh" width="45%" :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="70px" 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('basicData.widtha')" :required="true" style="width: 14vw">
               <el-select
                      v-model="selectedValue"
                      filterable
                      clearable
                      :placeholder="$t('basicData.selectwidth')"
                      style="width: 220px"
                      @input="handleInputChangea"
                    >
                 <el-option
                    v-for="item in selectOptions"
                    :key="item.id"
                    :label="item.label"
                    :value="item.value"
                 />
               </el-select>
              </el-form-item>
              </div></div>
          </el-col>
          <el-col :span="9">
            <div id="dta" style="font-size: 15px;">
        <div>
          <el-form-item :label="$t('basicData.heighta')" :required="true" style="width: 14vw">
            <el-select
                      v-model="selectedValuea"
                      filterable
                      clearable
                      :placeholder="$t('basicData.selectheight')"
                      style="width: 220px"
                      @input="handleInputChangea"
                    >
                 <el-option
                    v-for="item in selectOptionsa"
                    :key="item.id"
                    :label="item.label"
                    :value="item.value"
                 />
               </el-select>
              </el-form-item></div>
              </div>
          </el-col>
        </el-row>
        <el-row style="margin-top: 10px;">
          <el-col :span="6">
              <div id="dt" style="font-size: 15px;">
        <div>
              <el-form-item :label="$t('basicData.coatingtypesa')"  :required="true" style="width: 14vw;">
                <el-select
                      v-model="selectedValueb"
                      filterable
                      clearable
                      :placeholder="$t('basicData.selectcoatingtypes')"
                      style="width: 220px"
                      @input="handleInputChangea"
                    >
                 <el-option
                    v-for="item in selectOptionsb"
                    :key="item.id"
                    :label="item.label"
                    :value="item.value"
                 />
               </el-select>
              </el-form-item></div></div>
          </el-col>
          <el-col :span="9">
            <div id="dta" style="font-size: 15px;">
        <div>
              <el-form-item :label="$t('basicData.thicknessa')" :required="true" style="width: 14vw">
                <el-select
                      v-model="selectedValuec"
                      filterable
                      clearable
                      :placeholder="$t('basicData.selectthickness')"
                      style="width: 220px"
                      @input="handleInputChangea"
                    >
                 <el-option
                    v-for="item in selectOptionsc"
                    :key="item.id"
                    :label="item.label"
                    :value="item.value"
                 />
               </el-select>
                <!-- <el-input v-model="patternThickness" autocomplete="off" /> -->
              </el-form-item></div></div>
          </el-col>
        </el-row>
        <el-row style="margin-top: 10px;">
          <el-col :span="6">
              <div id="dt" style="font-size: 15px;">
        <div>
              <el-form-item :label="$t('basicData.quantitya')" :required="true" style="width: 14vw;">
                <el-input :placeholder="$t('basicData.selectquantity')" v-model="number" autocomplete="off" />
              </el-form-item></div></div>
          </el-col>
        </el-row>
        </el-form>
            </el-form>
          </div>
    <template #footer>
      <div id="dialog-footer">
        <el-button type="primary" @click="handleConfirm">
          {{ $t('basicData.confirm') }}
        </el-button>
        <el-button @click="add = false">{{ $t('basicData.cancel') }}</el-button>
      </div>
    </template>
  </el-dialog>
  <el-dialog v-model="adda" top="30vh" width="25%" :title="$t('basicData.deletemessage')">
    <template #footer>
      <div id="dialog-footer">
        <el-button type="primary" @click="handleConfirma">
          {{ $t('basicData.confirm') }}
        </el-button>
        <el-button @click="adda = false">{{ $t('basicData.cancel') }}</el-button>
      </div>
    </template>
  </el-dialog>
        </div>
  <el-dialog v-model="dialogFormVisible" top="24vh" width="50%"  >
  <el-dialog v-model="dialogFormVisible" top="24vh" width="70%">
    <div class="flex-container" style="margin-left: 50px;margin-bottom: 10px;">
    <el-form-item :label="$t('Mounting.loadingline')" :required="true">
    <el-select v-model="loadingline" clearable :placeholder="$t('Mounting.inloadingline')"  >
      <el-option :label="$t('Mounting.oneloadingline')" value="1"></el-option>
      <el-option :label="$t('Mounting.twoloadingline')" value="2"></el-option>
    </el-select>
              </el-form-item>
      <el-form-item :label="$t('Mounting.loadingline')" :required="true">
        <el-select disabled v-model="stationCell" clearable :placeholder="$t('Mounting.inloadingline')">
          <el-option :label="$t('Mounting.oneloadingline')" value="1"></el-option>
          <el-option :label="$t('Mounting.twoloadingline')" value="2"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item :label="$t('Mounting.projecta')" :required="true">
        <el-select
           v-model="selectedProjectNo"
           filterable
           clearable
           :placeholder="$t('basicData.plselectproject')"
           style="width: 220px"
           @input="handleInputChange"
         >
        <el-select
            v-model="selectedProjectNo"
            filterable
            clearable
            :placeholder="$t('basicData.plselectproject')"
            style="width: 220px"
            @input="handleInputChange"
        >
          <el-option
              v-for="item in titleSelectJson['engineerId']"
              :key="item.id"
              :label="item.engineerId"
              :value="item.engineerId"
              :label="item.projectNo"
              :value="item.projectNo"
          />
    </el-select>
              </el-form-item>
          </div>
        </el-select>
      </el-form-item>
      <el-form-item :label="$t('Mounting.removalmethoda')" :required="true">
        <el-select v-model="filmRemove" clearable :placeholder="$t('Mounting.removalmethod')">
          <el-option :label="$t('Mounting.noremoval')" value="0"></el-option>
          <el-option :label="$t('Mounting.coarselyground')" value="1"></el-option>
          <el-option :label="$t('Mounting.finegrinding')" value="2"></el-option>
        </el-select>
      </el-form-item>
    </div>
    <template #footer>
      <div id="dialog-footer">
        <el-button type="primary" @click="handleup">
        <el-button type="primary" @click="handlesure">
          {{ $t('basicData.confirm') }}
        </el-button>
        <el-button @click="dialogFormVisible = false">{{ $t('basicData.cancel') }}</el-button>
      </div>
    </template>
  </el-dialog>
</template>
 
<style scoped>
UI-Project/src/views/Returns/upreturns2.vue
@@ -1,112 +1,158 @@
<script lang="ts" setup>
import {Search} from "@element-plus/icons-vue";
import {reactive} from "vue";
import {onBeforeUnmount, onMounted, onUnmounted, 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'
const { t } = useI18n()
import { WebSocketHost ,host} from '@/utils/constants'
import {ElMessage} 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 {t} = useI18n()
const selectValuesa = reactive([]);
const selectedProjectNo = ref(''); // 当前选中的工程号
const loadingline = ref(''); // 当前选中的上片线
const selectedProjectNo = ref('');
const stationCell = ref('2');
const filmRemove = ref('');
const dialogFormVisible = ref(false)
const blind = ref(false)
const blinda = ref(false)
const blindb = ref(false)
const add = ref(false)
const adda = ref(false)
const dialoglea = ref(false)
const tableDatax = ref([])
const user = ref('');
const projectNo = ref('');
const workstationId = ref('');
const id = ref('');
const patternHeight = ref('');
const patternWidth = ref('');
const filmsId = ref('');
const patternThickness = ref('');
const number = ref('');
const canSelectProject = ref(true);
const canStartLoading = ref(false);
const selectedValue = ref(''); // 当前选中的宽
const selectedValuea = ref('');
const selectedValueb = ref('');
const selectedValuec = ref('');
// const upstatus = ref('上片机手动状态:'); // 假设这个用于显示自动/手动状态
const upstatus = ref(t('basicData.machineaa'));
const cuttingMachine = ref(''); // 假设这个用于存储后端返回的状态值(0或1)
const cuttingMachineStatusColor = ref('#911005'); // 用于动态设置i标签的背景色 
const inKageWord = ref(0); // 用于存储要传递给接口的inKageWord值
const options = ref<any[]>([]); // 下拉选项列表
const ida = ref(null);
const selectOptions = ref<Array<any>>([]); // 下拉选选项数组
const selectOptionsa = ref<Array<any>>([]); // 下拉选选项数组
const selectOptionsb = ref<Array<any>>([]); // 下拉选选项数组
const selectOptionsc = ref<Array<any>>([]); // 下拉选选项数组
  const tableDataa = ref([])
  const tableData = reactive([]);
const tableDataa = ref<any[]>([]);
const tableDatab = ref<any[]>([]);
const tableData = ref([])
// const tableData = reactive([]);
const titleSelectJson = ref({
  engineerId: [],
})
const handlezhiban = () => {
  dialoglea.value = true; // 打开绑定架子对话框
  dialoglea.value = true;
  fetchFlowCardId();
};
const selectproject = () => {
  dialogFormVisible.value = true;
  selectgong();
};
const markingMachineStatus = ref('#911005');
const cuttingMachineStatus = ref('#911005');
const confirmMarkingMachine = () => {
  markingMachineStatus.value = 'green';
};
const confirmCuttingMachine = () => {
  cuttingMachineStatus.value = 'green';
};
onMounted(() => {
  // socket = initializeWebSocket(socketUrl, handleMessage);
  socket = initializeWebSocket(socketUrl, handleMessage);
});
  onUnmounted(() => {
    if (socket) {
onUnmounted(() => {
  if (socket) {
    closeWebSocket(socket);
  }
});
const fetchTableData = async () => {
  try {
    const response = await request.get("/loadGlass/up-patten-usage/prioritylist");
    if (response.code === 200) {
      tableData.splice(0, tableData.length, ...response.data);
      ElMessage.error(response.message);
    }
    });
//定义接收加载表头下拉数据
const titleSelectJson = ref({
  processType: [],
})
const titleSelectJsona = ref({
  processTypea: [],
})
  } catch (error) {
    // 处理请求失败的情况
    // ElMessage.error('获取表格数据失败,请重试');
  }
};
let socket = null;
const socketUrl = `ws://${WebSocketHost}:${host}/api/loadGlass/api/talk/loadGlass`;
// 定义消息处理函数,更新 receivedData 变量
const requestData = {
  state: 100
};
const socketUrl = `ws://${WebSocketHost}:${host}/api/loadGlass/api/talk/uploadGlass`;
const handleMessage = (data: any) => {
  tableDataa.value = data.list[0].slice(0, 2);
  tableDatab.value = data.list[0].slice(2, 4);
};
onBeforeUnmount(() => {
  closeWebSocket();
});
// 添加
const handleBindRack = (row) => {
  workstationId.value = row.workstationId; // 假设rackNumber是架号字段的属性名
  ida.value = row.id;
  add.value = true; // 打开绑定架子对话框
const requestData = {
  state: 100
};
// 暂停
const handlea = async () => {
  try  {
  let engineeringId = window.localStorage.getItem('engineeringId')
console.log(engineeringId);
if (engineeringId !== '') {
  const response = await request.post('/loadGlass/engineering/engineering/pauseTask', {
      engineeringId: engineeringId,
      state: 0,
const selectgong = async (queryString: string) => {
  try {
    const response = await request.post('/loadGlass/optimizeProject/listByState', {
      ...requestData,
      query: queryString
    });
    if (response.code == 200) {
      titleSelectJson.value.engineerId = response.data;
    } else {
      ElMessage.error(response.message);
    }
  } catch (error) {
    console.error(error);
  }
};
//选择工程预览确认
const handlesure = async () => {
  try {
    const response = await request.post('/loadGlass/up-patten-usage/selectUpPattenUsage', {
      stationCell: 2,
      engineerId: selectedProjectNo.value,
      filmRemove: filmRemove.value,
    })
    window.localStorage.setItem('engineeringId', selectedProjectNo.value)
    window.localStorage.setItem('filmRemove', filmRemove.value)
    if (response.code == 200) {
      ElMessage.success(response.message);
      blinda.value = false;
      // tableData.splice([]);
      selectedProjectNo.value = ''
      filmRemove.value = ''
    } else {
      // 请求失败,显示错误消息
      ElMessage.error(response.message);
    }
  } catch (error) {
    console.error(error);
  }
}
// 开始上片
const handleon = async () => {
  let filmRemove = window.localStorage.getItem('filmRemove')
  let engineeringId = window.localStorage.getItem('engineeringId')
  if (markingMachineStatus.value === 'green' && cuttingMachineStatus.value === 'green') {
    try {
      const response = await request.post('/loadGlass/engineering/engineering/changeTask', {
        stationCell: 2,
        filmRemove: filmRemove,
        engineerId: engineeringId,
        state: 1,
      })
      if (response.code == 200) {
        ElMessage.success(response.message);
        blind.value = false;
      } else {
        ElMessage.error(response.message);
      }
    } catch (error) {
      console.error(error);
    }
  } else if (markingMachineStatus.value === '#911005' || cuttingMachineStatus.value === '#911005') {
    // 提示用户打标机未就绪
    ElMessage.warning(t('basicData.pausea'));
  }
}
// 暂停
const handleup = async () => {
  try {
    let engineeringId = window.localStorage.getItem('engineeringId')
    console.log(engineeringId);
    if (engineeringId !== '') {
      const response = await request.post('/loadGlass/engineering/engineering/pauseTask', {
        stationCell: 2,
        engineeringId: engineeringId,
        state: 0,
      })
      if (response.code == 200) {
      ElMessage.success(response.message);
      blinda.value = false;
    } else {
      ElMessage.error(response.message);
    }
  }
@@ -116,73 +162,74 @@
        message: t('basicData.infonull'),
      })
    }
}
catch (error) {
    // 处理错误
  } catch (error) {
    console.error(error);
  }
}
function getStatusText(state: number) {
  switch (state) {
    case 0:
      return t('basicData.waiting');
    case 1:
      return t('basicData.up');
    case 2:
    return t('basicData.up');
    case 100:
    return t('basicData.finish');
  }
}
function getStatusType(state: number) {
  switch (state) {
    case 0:
      return 'warning';
    case 1:
      return 'primary';
    case 2:
      return 'primary';
    case 100:
      return 'success';
  }
}
// 查询数据
const selectReportData = async () => {
  let stateList = []
  if (selectValuesa[1] != null && selectValuesa[1] != 'undefined') {
    if (selectValuesa[1] != "") {
      stateList = [selectValuesa[1]];
    }
  }
  const response = await request.post("/cacheVerticalGlass/damage/selectDamage", {
    taskState: stateList,
    taskType: 1
  })
  if (response.code === 200) {
    tableData.value = response.data;
    ElMessage.success(response.message);
  } else {
    ElMessage.error(response.message);
  }
};
// 值班信息
const fetchFlowCardId = async () => {
  try {
    const response = await request.post('/loadGlass/work_assignment/selectWorkAssignment', {
      line: 2001,
      workingProcedure: '冷加工'
    })
    if (response.code == 200) {
      ElMessage.success(response.message);
      tableDatax.value = response.data;
    } else {
      ElMessage.error(response.message);
    }
  } catch (error) {
    console.error(error);
  }
}
onMounted(fetchTableData);
// 开始上片
const handleBind = (row) => {
  blind.value = true; // 打开绑定架子对话框
  blind.value = true;
};
// 暂停
const handleBinda = (row) => {
  blinda.value = true;
};
// 停止任务
const handleBindb = (row) => {
  blindb.value = true;
};
// 删除
const handleBindRacka = (row) => {
  workstationId.value = row.workstationId;
  adda.value = true;
};
const toggleEnableState = async (row: any) => {
const toggleEnableState = async (row: any) => {
  // 检查 id 是否为空  
  if (!row.id) {  
    ElMessage.error(t('basicData.updatanull'));  
    return; // 如果 id 为空,则不执行后续操作  
  }  
  const newState = row.state === 100 ? 0 : 100;
  try {
    // 发送请求到后端更新状态
    const response = await request.post('/loadGlass/up-patten-usage/updateGlassState', { id: row.id, state: newState });
    if (response.code === 200) {
      ElMessage.success(response.message);
      row.state = newState;
    } else {
      ElMessage.error(response.message);
    }
  } catch (error) {
    // 处理请求错误
    ElMessage.error(t('basicData.glassnull'));
  const newState = row.state === 100 ? 0 : 100;
  try {
    const response = await request.post('/loadGlass/up-patten-usage/updateGlassState', {id: row.id, state: newState});
    if (response.code === 200) {
      ElMessage.success(response.message);
      row.state = newState;
    } else {
      ElMessage.error(response.message);
    }
  } catch (error) {
    ElMessage.error(t('basicData.glassnull'));
  }  
};
</script>
@@ -198,13 +245,13 @@
    <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 style="margin-top: 5px;margin-left: 15px;"  type="primary" @click="selectproject">{{ $t('Mounting.previewproject') }}</el-button>
    <el-button style="margin-top: 5px;margin-left: 20px;" type="success" @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="info" @click="handlezhiban">{{ $t('searchOrder.dutyinformation') }}</el-button>
    <el-select v-model="selectValuesa[1]" clearable :placeholder="$t('Mounting.loadinglinea')" style="margin-top: 5px;margin-left: 20px;" >
    <el-select disabled v-model="selectValuesa[1]" clearable :placeholder="$t('Mounting.twoloadingline')"
               style="margin-top: 5px;margin-left: 20px;">
      <el-option :label="$t('Mounting.all')" value="0"></el-option>
      <el-option :label="$t('Mounting.oneloadingline')" value="1"></el-option>
      <el-option :label="$t('Mounting.twoloadingline')" value="2"></el-option>
@@ -254,79 +301,78 @@
      </div>
    </el-card>
    <div style="display: flex;">
  <div style="width: 49%;float: left;">
    <div style="display: flex;">
        <img src="../../assets/shangpianji.png" alt="" style="max-width: 25%;max-height: 25%;margin-left: 10%;margin-top: 5%;">
        <el-table :data="tableDataa" border style="width: 75%;margin-top: 10%;margin-left: 2%;"
     :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"
        >
          <el-table-column prop="workstationId" align="center" :label="$t('basicData.station')" min-width="60" />
          <el-table-column prop="patternWidth" align="center" :label="$t('basicData.width')" min-width="80" />
          <el-table-column prop="patternHeight" align="center" :label="$t('basicData.height')" min-width="80" />
          <el-table-column prop="filmsId" align="center" :label="$t('basicData.coatingtypes')" min-width="80" />
          <el-table-column prop="number" align="center" :label="$t('basicData.quantity')" min-width="80" />
        </el-table>
    </div>
  </div>
    <div style="width: 48%;float: right;">
      <div style="display: flex;">
        <img src="../../assets/shangpianji.png" alt="" style="max-width: 25%;max-height: 25%;margin-left: 10%;margin-top: 5%;">
        <el-table :data="tableDataa" border style="width: 75%;margin-top: 10%;margin-left: 2%;"
     :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"
        >
          <el-table-column prop="workstationId" align="center" :label="$t('basicData.station')" min-width="60" />
          <el-table-column prop="patternWidth" align="center" :label="$t('basicData.width')" min-width="80" />
          <el-table-column prop="patternHeight" align="center" :label="$t('basicData.height')" min-width="80" />
          <el-table-column prop="filmsId" align="center" :label="$t('basicData.coatingtypes')" min-width="80" />
          <el-table-column prop="number" align="center" :label="$t('basicData.quantity')" min-width="80" />
        </el-table>
      <!-- <div style="width: 49%;float: left;margin-left: 300px;">
        <div style="display: flex;">
            <img src="../../assets/shangpianji.png" alt="" style="max-width: 25%;max-height: 25%;margin-left: 10%;margin-top: 5%;">
            <el-table :data="tableDataa" border style="width: 75%;margin-top: 10%;margin-left: 2%;"
         :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"
            >
              <el-table-column prop="workstationId" align="center" :label="$t('basicData.station')" min-width="60" />
              <el-table-column prop="patternWidth" align="center" :label="$t('basicData.width')" min-width="80" />
              <el-table-column prop="patternHeight" align="center" :label="$t('basicData.height')" min-width="80" />
              <el-table-column prop="filmsId" align="center" :label="$t('basicData.coatingtypes')" min-width="80" />
              <el-table-column prop="number" align="center" :label="$t('basicData.quantity')" min-width="80" />
            </el-table>
        </div>
      </div> -->
      <div style="width: 48%;float: right;margin-left: 300px;">
        <div style="display: flex;">
          <img src="../../assets/shangpianji.png" alt=""
               style="max-width: 25%;max-height: 25%;margin-left: 10%;margin-top: 5%;">
          <el-table :data="tableDatab" border style="width: 75%;margin-top: 10%;margin-left: 2%;"
                    :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"
          >
            <el-table-column prop="workstationId" align="center" :label="$t('basicData.station')" min-width="60"/>
            <el-table-column prop="patternWidth" align="center" :label="$t('basicData.width')" min-width="80"/>
            <el-table-column prop="patternHeight" align="center" :label="$t('basicData.height')" min-width="80"/>
            <el-table-column prop="filmsId" align="center" :label="$t('basicData.coatingtypes')" min-width="80"/>
            <el-table-column prop="number" align="center" :label="$t('basicData.quantity')" min-width="80"/>
          </el-table>
    </div>
</div>
</div>
  <el-dialog v-model="blind" top="30vh" width="25%" :title="$t('basicData.startfilm')">
    <template #footer>
      <div id="dialog-footer">
        <el-button type="primary" @click="handle">
        <el-button type="primary" @click="handleon">
          {{ $t('basicData.confirm') }}
        </el-button>
        <el-button @click="blind = false">{{ $t('basicData.cancel') }}</el-button>
      </div>
    </template>
  </el-dialog>
<el-dialog v-model="dialoglea" top="15vh" width="70%" :title="$t('searchOrder.dutyinformation')">
    <el-table  ref="table" style="margin-top: 20px;height: 300px;"
        :data="tableDatax" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}">
          <el-table-column prop="line" fixed align="center" :label="$t('searchOrder.line')"/>
          <el-table-column prop="workProcesses" fixed align="center" :label="$t('searchOrder.process')" />
          <el-table-column prop="teamsGroupsName" align="center" :label="$t('searchOrder.team')">
        <template #default="{ row }">
          <el-input v-model="row.teamsGroupsName" autocomplete="off" min-width="150"/>
        </template>
      </el-table-column>
          <el-table-column prop="deviceName" align="center" :label="$t('searchOrder.basic')">
            <template #default="{ row }">
          <el-input v-model="row.deviceName" autocomplete="off" min-width="150"/>
        </template>
    <el-dialog v-model="dialoglea" top="15vh" width="70%" :title="$t('searchOrder.dutyinformation')">
      <el-table ref="table" style="margin-top: 20px;height: 300px;"
                :data="tableDatax" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}">
        <el-table-column prop="line" fixed align="center" :label="$t('searchOrder.line')"/>
        <el-table-column prop="workProcesses" fixed align="center" :label="$t('searchOrder.process')"/>
        <el-table-column prop="teamsGroupsName" align="center" :label="$t('searchOrder.team')">
          <!-- <template #default="{ row }">
            <el-input v-model="row.teamsGroupsName" autocomplete="off" min-width="150"/>
          </template>   -->
        </el-table-column>
        <el-table-column prop="deviceName" align="center" :label="$t('searchOrder.basic')">
          <!-- <template #default="{ row }">
        <el-input v-model="row.deviceName" autocomplete="off" min-width="150"/>
      </template> -->
        </el-table-column>
        </el-table>
        <template #footer>
      <div id="dialog-footer">
        <el-button type="primary" @click="handleConfirm">
          {{ $t('searchOrder.add') }}
        </el-button>
        <el-button @click="dialoglea = false">{{ $t('searchOrder.cancel') }}</el-button>
        <el-button @click="dialoglea = false">{{ $t('large.close') }}</el-button>
      </div>
    </template>
</el-dialog>
  <el-dialog v-model="blinda" top="24vh" width="30%" :title="$t('basicData.whetherpause')">
    <div style="margin-left: 50px;margin-bottom: 10px;">
    <el-form-item :label="$t('Mounting.loadingline')" :required="true">
    <el-select v-model="loadingline" clearable :placeholder="$t('Mounting.inloadingline')" style="margin-left: 20px;" >
      <el-option :label="$t('Mounting.all')" value="0"></el-option>
      <el-option :label="$t('Mounting.oneloadingline')" value="1"></el-option>
      <el-option :label="$t('Mounting.twoloadingline')" value="2"></el-option>
    </el-select>
      <el-select disabled v-model="stationCell" clearable :placeholder="$t('Mounting.inloadingline')"
                 style="margin-left: 20px;">
        <el-option :label="$t('Mounting.all')" value="0"></el-option>
        <el-option :label="$t('Mounting.oneloadingline')" value="1"></el-option>
        <el-option :label="$t('Mounting.twoloadingline')" value="2"></el-option>
      </el-select>
    </el-form-item>
    </div>
    <template #footer>
@@ -338,169 +384,50 @@
      </div>
    </template>
  </el-dialog>
  <el-dialog v-model="add" top="23vh" width="45%" :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="70px" 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('basicData.widtha')" :required="true" style="width: 14vw">
               <el-select
                      v-model="selectedValue"
                      filterable
                      clearable
                      :placeholder="$t('basicData.selectwidth')"
                      style="width: 220px"
                      @input="handleInputChangea"
                    >
                 <el-option
                    v-for="item in selectOptions"
                    :key="item.id"
                    :label="item.label"
                    :value="item.value"
                 />
               </el-select>
              </el-form-item>
              </div></div>
          </el-col>
          <el-col :span="9">
            <div id="dta" style="font-size: 15px;">
        <div>
          <el-form-item :label="$t('basicData.heighta')" :required="true" style="width: 14vw">
            <el-select
                      v-model="selectedValuea"
                      filterable
                      clearable
                      :placeholder="$t('basicData.selectheight')"
                      style="width: 220px"
                      @input="handleInputChangea"
                    >
                 <el-option
                    v-for="item in selectOptionsa"
                    :key="item.id"
                    :label="item.label"
                    :value="item.value"
                 />
               </el-select>
              </el-form-item></div>
              </div>
          </el-col>
        </el-row>
        <el-row style="margin-top: 10px;">
          <el-col :span="6">
              <div id="dt" style="font-size: 15px;">
        <div>
              <el-form-item :label="$t('basicData.coatingtypesa')"  :required="true" style="width: 14vw;">
                <el-select
                      v-model="selectedValueb"
                      filterable
                      clearable
                      :placeholder="$t('basicData.selectcoatingtypes')"
                      style="width: 220px"
                      @input="handleInputChangea"
                    >
                 <el-option
                    v-for="item in selectOptionsb"
                    :key="item.id"
                    :label="item.label"
                    :value="item.value"
                 />
               </el-select>
              </el-form-item></div></div>
          </el-col>
          <el-col :span="9">
            <div id="dta" style="font-size: 15px;">
        <div>
              <el-form-item :label="$t('basicData.thicknessa')" :required="true" style="width: 14vw">
                <el-select
                      v-model="selectedValuec"
                      filterable
                      clearable
                      :placeholder="$t('basicData.selectthickness')"
                      style="width: 220px"
                      @input="handleInputChangea"
                    >
                 <el-option
                    v-for="item in selectOptionsc"
                    :key="item.id"
                    :label="item.label"
                    :value="item.value"
                 />
               </el-select>
                <!-- <el-input v-model="patternThickness" autocomplete="off" /> -->
              </el-form-item></div></div>
          </el-col>
        </el-row>
        <el-row style="margin-top: 10px;">
          <el-col :span="6">
              <div id="dt" style="font-size: 15px;">
        <div>
              <el-form-item :label="$t('basicData.quantitya')" :required="true" style="width: 14vw;">
                <el-input :placeholder="$t('basicData.selectquantity')" v-model="number" autocomplete="off" />
              </el-form-item></div></div>
          </el-col>
        </el-row>
        </el-form>
            </el-form>
          </div>
    <template #footer>
      <div id="dialog-footer">
        <el-button type="primary" @click="handleConfirm">
          {{ $t('basicData.confirm') }}
        </el-button>
        <el-button @click="add = false">{{ $t('basicData.cancel') }}</el-button>
      </div>
    </template>
  </el-dialog>
  <el-dialog v-model="adda" top="30vh" width="25%" :title="$t('basicData.deletemessage')">
    <template #footer>
      <div id="dialog-footer">
        <el-button type="primary" @click="handleConfirma">
          {{ $t('basicData.confirm') }}
        </el-button>
        <el-button @click="adda = false">{{ $t('basicData.cancel') }}</el-button>
      </div>
    </template>
  </el-dialog>
        </div>
  <el-dialog v-model="dialogFormVisible" top="24vh" width="50%"  >
  </div>
  <el-dialog v-model="dialogFormVisible" top="24vh" width="70%">
    <div class="flex-container" style="margin-left: 50px;margin-bottom: 10px;">
    <el-form-item :label="$t('Mounting.loadingline')" :required="true">
    <el-select v-model="loadingline" clearable :placeholder="$t('Mounting.inloadingline')"  >
      <el-option :label="$t('Mounting.oneloadingline')" value="1"></el-option>
      <el-option :label="$t('Mounting.twoloadingline')" value="2"></el-option>
    </el-select>
              </el-form-item>
      <el-form-item :label="$t('Mounting.loadingline')" :required="true">
        <el-select disabled v-model="stationCell" clearable :placeholder="$t('Mounting.inloadingline')">
          <el-option :label="$t('Mounting.oneloadingline')" value="1"></el-option>
          <el-option :label="$t('Mounting.twoloadingline')" value="2"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item :label="$t('Mounting.projecta')" :required="true">
        <el-select
           v-model="selectedProjectNo"
           filterable
           clearable
           :placeholder="$t('basicData.plselectproject')"
           style="width: 220px"
           @input="handleInputChange"
         >
      <el-option
         v-for="item in titleSelectJson['processType']"
         :key="item.id"
         :label="item.projectNo"
         :value="item.projectNo"
      />
    </el-select>
              </el-form-item>
          </div>
        <el-select
            v-model="selectedProjectNo"
            filterable
            clearable
            :placeholder="$t('basicData.plselectproject')"
            style="width: 220px"
            @input="handleInputChange"
        >
          <el-option
              v-for="item in titleSelectJson['engineerId']"
              :key="item.id"
              :label="item.projectNo"
              :value="item.projectNo"
          />
        </el-select>
      </el-form-item>
      <el-form-item :label="$t('Mounting.removalmethoda')" :required="true">
        <el-select v-model="filmRemove" clearable :placeholder="$t('Mounting.removalmethod')">
          <el-option :label="$t('Mounting.noremoval')" value="0"></el-option>
          <el-option :label="$t('Mounting.coarselyground')" value="1"></el-option>
          <el-option :label="$t('Mounting.finegrinding')" value="2"></el-option>
        </el-select>
      </el-form-item>
    </div>
    <template #footer>
      <div id="dialog-footer">
        <el-button type="primary" @click="handleup">
        <el-button type="primary" @click="handlesure">
          {{ $t('basicData.confirm') }}
        </el-button>
        <el-button @click="dialogFormVisible = false">{{ $t('basicData.cancel') }}</el-button>
      </div>
    </template>
  </el-dialog>
</template>
 
<style scoped>
hangzhoumesParent/common/servicebase/src/main/java/com/mes/engineering/entity/Engineering.java
@@ -96,10 +96,14 @@
     * 备注
     */
    private String notes;
    /**
     * 上片机线路
     */
    private int stationCell;
    private Integer stationCell;
    /**
     * 除膜方式
     */
    private Integer filmRemove;
}
hangzhoumesParent/common/springsecurity/src/main/java/com/mes/userinfo/service/impl/SysUserServiceImpl.java
@@ -1,6 +1,5 @@
package com.mes.userinfo.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -25,7 +24,6 @@
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.Authentication;
@@ -72,7 +70,7 @@
    @Resource
    BCryptPasswordEncoder passwordEncoder;
    @Autowired
    @Resource
    private SysUserRoleMapper sysUserRoleMapper;
    @Override
hangzhoumesParent/gateway/src/main/resources/application.yml
@@ -47,7 +47,6 @@
          filters:
            - StripPrefix=2
        - id: glassStorage
          uri: lb://glassStorage
          predicates:
hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/engineering/controller/EngineeringController.java
@@ -69,7 +69,7 @@
        log.info("engineeringId:{}", engineering);
        UpPattenUsage upPattenUsage = upPattenUsageService.selectedEngineering(engineering.getEngineerId());
        if (upPattenUsage != null) {
            boolean work=engineeringService.changeTask(engineering.getEngineerId(),engineering.getState());
            boolean work = engineeringService.changeTask(engineering.getEngineerId(), engineering.getState(), engineering.getFilmRemove(), engineering.getStationCell());
            List<UpPattenUsage> glass = upPattenUsageService.prioritylist();
            optimizeProjectService.changeTask(engineering.getEngineerId(), 200);
            return Result.build(200, "已保存过", work);
@@ -85,7 +85,7 @@
            engineeringService.saveEngineering(listEngineering);
            log.info("更改pp表状态为已领取");
            //将engineering表状态为正在上片
            boolean work=engineeringService.changeTask(engineering.getEngineerId(),engineering.getState());
            boolean work = engineeringService.changeTask(engineering.getEngineerId(), engineering.getState(), engineering.getFilmRemove(), engineering.getStationCell());
            List<UpPattenUsage> glass = upPattenUsageService.prioritylist();
            optimizeProjectService.changeTask(engineering.getEngineerId(), 200);
            if (work) {
hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/engineering/entity/Engineering.java
@@ -32,11 +32,15 @@
     */
    private String engineerId;
    /**
     * 设备
     */
    private String stationCell;
    private Integer stationCell;
    /**
     * 除膜方式
     */
    private Integer filmRemove;
    /**
     * 工程名称
hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/engineering/service/EngineeringService.java
@@ -54,4 +54,6 @@
    List<Engineering> selectTask();
    boolean pauseTask(String engineerId, Integer state);
    boolean changeTask(String engineerId, Integer state, Integer filmRemove, Integer stationCell);
}
hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/engineering/service/impl/EngineeringServiceImpl.java
@@ -119,9 +119,14 @@
    public boolean pauseTask(String engineerId, Integer state) {
        //暂停正在进行工程
        LambdaUpdateChainWrapper<Engineering> pauseWrapper = new LambdaUpdateChainWrapper<>(this.getBaseMapper());
        pauseWrapper.set(Engineering::getState,0);
        pauseWrapper.eq(Engineering::getState,1);
        return  pauseWrapper.update();
        pauseWrapper.set(Engineering::getState, 0);
        pauseWrapper.eq(Engineering::getState, 1);
        return pauseWrapper.update();
    }
    @Override
    public boolean changeTask(String engineerId, Integer state, Integer filmRemove, Integer stationCell) {
        return false;
    }
}