wu
2024-07-24 c11bf3b956e09dd4d917074f1076d3ef48747492
Merge remote-tracking branch 'origin/master'
6个文件已修改
245 ■■■■ 已修改文件
UI-Project/src/lang/zh.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UI-Project/src/layout/MainErpView.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UI-Project/src/views/Identify/identify.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UI-Project/src/views/PurchaseReturn/purchaseReturn.vue 89 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UI-Project/src/views/PurchaseReturn/purchaseStorage.vue 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UI-Project/src/views/Returns/returns.vue 89 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UI-Project/src/lang/zh.js
@@ -83,6 +83,7 @@
        updatanull:'该工程未保存到上片表!',
        glassnull:'更新玻璃状态时发生错误',
        deletemessage:'是否删除该条信息?',
        layoutSequence:'序号',
    },
    sorter:{
        gridnumber:'栅格号',
UI-Project/src/layout/MainErpView.vue
@@ -169,6 +169,10 @@
               alt=""
               style="max-width: 100%;max-height: 100%">
          <h3 style="margin: 1rem  ;font-weight: bold;width: 33vw;"> {{ $t('main.titleFirst') }}{{ user }}{{ $t('main.titleLast') }}</h3>
          <!-- <div class="header-left">
            <el-button :icon="isCollapse ? 'el-icon-s-unfold' : 'el-icon-s-fold'" @click="toggleCollapse"
              style="height:30px;"></el-button>
          </div> -->
          <span style="height: 70%;width: 78vw;margin-top: 1rem;">
            <!-- <el-button class="sys-quit"
                       @click="quit"
UI-Project/src/views/Identify/identify.vue
@@ -111,7 +111,6 @@
  //   controlsId: 201,
  //   })
    if (response.code == 200) {
      // 绑定成功,处理逻辑
      ElMessage.success(response.message);
      // window.location.reload() 
      blind.value = false;
@@ -126,7 +125,7 @@
    console.error(error);
  }
}
// // 人工拿走
 // 人工拿走
const handleManualTake = async () => {
  try  {
    var url="/cacheGlass/taskCache/identControls?identId="+currentGlassId.value+'&controlsId='+200;
UI-Project/src/views/PurchaseReturn/purchaseReturn.vue
@@ -5,6 +5,7 @@
import request from "@/utils/request"
import { ref, onMounted, onBeforeUnmount } from 'vue';  
import { WebSocketHost ,host} from '@/utils/constants'
import { ElMessage, ElMessageBox } from 'element-plus'
import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService';
  import { useI18n } from 'vue-i18n'
  const { t } = useI18n()
@@ -19,6 +20,8 @@
const adjustedRects2 = ref([]);
const adjustedRectsa = ref([]);
const adjustedRectsb = ref([]);
const currentGlassId = ref(null);
const currenttemperingFeedSequence = ref(null);
const socketUrl = `ws://${WebSocketHost}:${host}/api/temperingGlass/api/talk/temperingGlass`;
const handleMessage = (data) => {
// 进炉中
@@ -140,19 +143,64 @@
onMounted(() => {
  initializeWebSocket(socketUrl, handleMessage);
});
function getRectColor(state) {
function updateRectColors() {
  adjustedRectsa.value.forEach(rect => {
    if (rect.glassId === glassId) {
      rect.state = 5;
    }
  });
}
function getRectColora(state) {
  switch (state) {  
    case 0:  
      return '#f8e3c5';
      return '#d1edc4';
    case 1:  
      return '#d1edc4';
      return '#E6E6FA';
    case -1:  
      return '#dedfe0';  
    case 5:
      return '#911005';
  }
}
function getRectColorb(state) {
  switch (state) {
    case 3:
      return '#f8e3c5';
    case 4:
      return '#F0F8FF';
    case 5:
      return '#911005';
  }  
}
function showDialog(row) {
}
function showDialog(rect) {
  currentGlassId.value = rect.glassId;
  currenttemperingFeedSequence.value = rect.temperingFeedSequence;
  blind.value = true;  
}  
// 破损
const handleDamage = async () => {
  try  {
  const response = await request.post('/temperingGlass/temperingGlassInfo/updateTemperingState', {
    glassId: currentGlassId.value,
    // temperingFeedSequence: currenttemperingFeedSequence.value,
    line: 4001,
    status: 2,
    workingProcedure: '钢化',
    })
    if (response.code == 200) {
      ElMessage.success(response.message);
      blind.value = false;
      updateRectColors();
    } else {
      // 请求失败,显示错误消息
      ElMessage.error(response.message);
    }
}
catch (error) {
    // 处理错误
    console.error(error);
  }
}
onBeforeUnmount(() => {
  console.log("关闭了")
  closeWebSocket();
@@ -173,8 +221,14 @@
      <div  
      v-for="(rect, index) in adjustedRects"
      :key="index"  
      @click="showDialog(rect)"
      class="rect"
      :style="{ position: 'absolute',  top: `${rect.ycoordinate}px`, left: `${rect.xcoordinate}px`, width: `${rect.width}px`, height: `${rect.height}px`  }"
      :style="{ position: 'absolute',
       top: `${rect.ycoordinate}px`,
       left: `${rect.xcoordinate}px`,
        width: `${rect.width}px`,
        height: `${rect.height}px`,
        backgroundColor: rect.state === 5 ? '#911005' : 'lightblue' }"
    >
     <div  class="centered-text">
    <div >{{ rect.glassId }}</div>  
@@ -194,9 +248,15 @@
      <div  
      v-for="(rect, index) in adjustedRects2"
      :key="index"  
      @click="showDialog(rect)"
      class="rect"
      :style="{ position: 'absolute',  top: `${rect.ycoordinate}px`, left: `${rect.xcoordinate}px`, width: `${rect.width}px`, height: `${rect.height}px`  }"
    >
      :style="{ position: 'absolute',
       top: `${rect.ycoordinate}px`,
       left: `${rect.xcoordinate}px`,
       width: `${rect.width}px`,
       height: `${rect.height}px`,
       backgroundColor: rect.state === 5 ? '#911005' : 'lightblue' }"
       >
     <div  class="centered-text">
    <div >{{ rect.glassId }}</div>  
    <div >{{ rect.flowCardId }}</div>  
@@ -214,17 +274,16 @@
  <el-card style="flex: 1;margin-left: 10px;margin-top: 10px;margin-right: 10px;height: 600px;" v-loading="loading">
    <div v-if="adjustedRectsa.length > 0">
      <div style="text-align: center;">炉号:{{ adjustedRects[0].engineerId }}-{{ adjustedRects[0].temperingLayoutId }}</div>  
      <!-- <div style="text-align: center;">流程卡: {{ adjustedRectsa[0].flowCardId }}</div>   -->
      <el-scrollbar height="550px" style="background-color: #e9e9eb;">
    <div  style="position: relative;max-width: 1400px;">  
      <div  
      v-for="(rect, index) in adjustedRectsa"  
      :key="index"  
      @click="showDialog"
      @click="showDialog(rect)"
      class="rect"  
      :style="{ position: 'absolute',  top: `${rect.y}px`, left: `${rect.x}px`,
       width: `${rect.width}px`, height: `${rect.height}px`,
      backgroundColor: getRectColor(rect.state) }">
      backgroundColor: getRectColora(rect.state) }">
    <div  class="centered-text">
    <div>{{ rect.glassId }}</div>  
    <div >{{ rect.flowCardId }}</div>  
@@ -246,10 +305,12 @@
      <div  
      v-for="(rect, index) in adjustedRectsb"  
      :key="index"  
      @click="showDialog(rect)"
      class="rect"  
      :style="{ position: 'absolute',  top: `${rect.y}px`, left: `${rect.x}px`,
       width: `${rect.width}px`, height: `${rect.height}px`,
       backgroundColor: rect.state === 4 ? '#911005' : '#f8e3c5' }">
      backgroundColor: getRectColorb(rect.state) }">
       <!-- backgroundColor: rect.state === 4 ? '#911005' : '#f8e3c5' }"> -->
     <div  class="centered-text">
    <div >{{ rect.glassId }}</div>  
    <div >{{ rect.flowCardId }}</div>  
@@ -263,7 +324,7 @@
</div>
<el-dialog v-model="blind" top="30vh" width="15%" style="text-align: center;">
        <el-button type="warning" plain :icon="Delete" @click="handleDamage(currentGlassId)"  style="width: 140px;margin-left: 10px;">
        <el-button type="warning" plain :icon="Delete" @click="handleDamage"  style="width: 140px;margin-left: 10px;">
          {{ $t('order.dilapidation') }}
        </el-button>
  </el-dialog> 
@@ -348,6 +409,6 @@
  justify-content: center;  
  align-items: center; 
  height: 100%; /* 确保div占据整个矩形的高度 */  
  font-size: small;
  /* font-size: small; */
</style>
UI-Project/src/views/PurchaseReturn/purchaseStorage.vue
@@ -2,14 +2,19 @@
import {Search} from "@element-plus/icons-vue";
import {reactive} from "vue";
import {useRouter} from "vue-router"
import { ElMessage, ElMessageBox } from 'element-plus'
import request from "@/utils/request"
import { ref, onMounted, onBeforeUnmount } from 'vue';  
import { WebSocketHost ,host} from '@/utils/constants'
import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService';
const adjustedRects = ref([]);
const currentGlassId = ref(null);
const currenttemperingFeedSequence = ref(null);
const dialogFormVisible = ref(true)
const dialogFormVisiblea = ref(false)
const blind = ref(false)
const getTableRow = (row,type) =>{
  switch (type) {
@@ -58,6 +63,52 @@
});
  }
};
function updateRectColors() {
  adjustedRectsa.value.forEach(rect => {
    if (rect.glassId === glassId) {
      rect.state = 5;
    }
  });
}
function getRectColora(state) {
  switch (state) {
    case 3:
      return '#f8e3c5';
    case 4:
      return '#F0F8FF';
    case 5:
      return '#911005';
  }
}
function showDialog(rect) {
  currentGlassId.value = rect.glassId;
  currenttemperingFeedSequence.value = rect.temperingFeedSequence;
  blind.value = true;
}
// 破损
const handleDamage = async () => {
  try  {
  const response = await request.post('/temperingGlass/temperingGlassInfo/updateTemperingState', {
    glassId: currentGlassId.value,
    // temperingFeedSequence: currenttemperingFeedSequence.value,
    line: 4001,
    status: 2,
    workingProcedure: '钢化',
    })
    if (response.code == 200) {
      ElMessage.success(response.message);
      blind.value = false;
      updateRectColors();
    } else {
      // 请求失败,显示错误消息
      ElMessage.error(response.message);
    }
}
catch (error) {
    // 处理错误
    console.error(error);
  }
}
onMounted(() => {
  // fetchFlowCardId();
  // fetchTableData(); // 获取数据
@@ -82,10 +133,11 @@
      <div  
      v-for="(rect, index) in adjustedRects"
      :key="index"  
      @click="showDialog(rect)"
      class="rect"  
      :style="{ position: 'absolute',  top: `${rect.ycoordinate}px`, left: `${rect.xcoordinate}px`,
       width: `${rect.width}px`, height: `${rect.height}px`,
       backgroundColor: rect.state === 4 ? '#d1edc4' : '#f8e3c5' }">
      backgroundColor: getRectColora(rect.state) }">
     <div  class="centered-text">
    <div >{{ rect.glassId }}</div>  
    <div >{{ rect.flowCardId }}</div>  
@@ -98,6 +150,11 @@
   </div>
    </el-card>
    </div>
    <el-dialog v-model="blind" top="30vh" width="15%" style="text-align: center;">
        <el-button type="warning" plain :icon="Delete" @click="handleDamage"  style="width: 140px;margin-left: 10px;">
          {{ $t('order.dilapidation') }}
        </el-button>
  </el-dialog>
  </div>
</template>
UI-Project/src/views/Returns/returns.vue
@@ -17,6 +17,15 @@
const flakea = ref(false)
const flakeb = ref(false)
const flakec = ref(false)
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('');
import { WebSocketHost ,host} from '@/utils/constants'
import request from "@/utils/request"
const ida = ref(null); 
@@ -93,16 +102,16 @@
    if (response.code == 200) {  
      tableDataa.value = response.data
          if (tableDataa.value.length === 4) {
          if (tableDataa.value[0].patternHeight > 0) {
          if (tableDataa.value[0].patternHeight > 0 && tableDataa.value[0].patternWidth > 0 && tableDataa.value[0].number > 0) {
          flake.value = true;
          }
         if (tableDataa.value[1].patternHeight > 0) {
         if (tableDataa.value[1].patternHeight > 0 && tableDataa.value[1].patternWidth > 0 && tableDataa.value[1].number > 0) {
          flakea.value = true;
          } 
         if (tableDataa.value[2].patternHeight > 0) {
         if (tableDataa.value[2].patternHeight > 0 && tableDataa.value[2].patternWidth > 0 && tableDataa.value[2].number > 0) {
          flakeb.value = true;
          } 
         if (tableDataa.value[3].patternHeight > 0) {
         if (tableDataa.value[3].patternHeight > 0 && tableDataa.value[3].patternWidth > 0 && tableDataa.value[3].number > 0) {
          flakec.value = true;
          } 
           }
@@ -196,15 +205,6 @@
onBeforeUnmount(() => {
  closeWebSocket();
});
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 handleBindRack = (row) => {
  workstationId.value = row.workstationId; // 假设rackNumber是架号字段的属性名
@@ -225,25 +225,38 @@
      patternThickness: selectedValuec.value,
      number: number.value
    }); 
      window.localStorage.setItem('workstationId', workstationId.value)
      window.localStorage.setItem('patternHeight', selectedValuea.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)
    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')
      if (patternHeight !== '' && workstationId === '1') {
      // 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 (patternHeight !== '' && workstationId === '2'){
    } else if (selectedValuea.value !== '0' && selectedValue.value !== '0' && number.value !== '0' && workstationId.value === '2'){
      flakea.value = true
    }else if (patternHeight !== '' && workstationId === '3'){
    }else if (selectedValuea.value !== '0' && selectedValue.value !== '0' && number.value !== '0' && workstationId.value === '3'){
      flakeb.value = true
    }else if (patternHeight !== '' && workstationId === '4'){
    }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 = '';
@@ -256,8 +269,6 @@
    }
  } catch (error) {  
      // 处理请求错误  
      console.error(error);
      alert('请求失败,请稍后再试!');
    }  
  }  
  else if( ida.value === 1 || ida.value === 3){
@@ -271,23 +282,19 @@
      patternThickness: selectedValuec.value,
      number: number.value
    }); 
      window.localStorage.setItem('workstationId', workstationId.value)
      window.localStorage.setItem('patternHeight', selectedValuea.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')
      if (patternHeight !== '' && workstationId === '1') {
      if (selectedValuea.value !== '0' && selectedValue.value !== '0' && number.value !== '0' && workstationId.value === '1') {
      flake.value = true
    } else if (patternHeight !== '' && workstationId === '2'){
    } else if (selectedValuea.value !== '0' && selectedValue.value !== '0' && number.value !== '0' && workstationId.value === '2'){
      flakea.value = true
    }else if (patternHeight !== '' && workstationId === '3'){
    }else if (selectedValuea.value !== '0' && selectedValue.value !== '0' && number.value !== '0' && workstationId.value === '3'){
      flakeb.value = true
    }else if (patternHeight !== '' && workstationId === '4'){
    }else if (selectedValuea.value !== '0' && selectedValue.value !== '0' && number.value !== '0' && workstationId.value === '4'){
      flakec.value = true
    }
      selectedValuea.value = '';
@@ -302,8 +309,6 @@
    }
  } catch (error) {  
      // 处理请求错误  
      console.error(error);
      alert('请求失败,请稍后再试!');
    } 
    }
  else  {
@@ -660,11 +665,17 @@
     :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"
      :data="tableData"
    >
    <el-table-column prop="engineeringId" :label="$t('basicData.projectnumber')" width="200" align="center"/>
      <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"/>
      <el-table-column prop="width" :label="$t('basicData.glasswidth')" align="center"/>
      <el-table-column prop="height" :label="$t('basicData.glassheight')" align="center"/>
      <el-table-column prop="filmsId" :label="$t('basicData.coatingtypes')" align="center"/>
      <el-table-column prop="layoutSequence" :label="$t('basicData.quantity')" align="center"/>
      <el-table-column :label="$t('basicData.quantity')" align="center">
      <template #default="{ row }">
        <!-- 这里总是显示 1 -->
        <span>{{ 1 }}</span>
      </template>
    </el-table-column>
      <el-table-column prop="thickness" :label="$t('basicData.thickness')" align="center"/>
      <!-- <el-table-column
            align="center"
@@ -928,7 +939,7 @@
  width: 1500px;
  margin-left: -300px
}
#overlay{
#overlayb{
  position: absolute;
  z-index: 1;
  width: 228px;
@@ -937,7 +948,7 @@
  margin-top: -303px;
  margin-left: 355px;
}
#overlaya{
#overlayc{
  position: absolute;
  z-index: 1;
  width: 228px;
@@ -946,7 +957,7 @@
  margin-top: -303px;
  margin-left:703px;
}
#overlayb{
#overlay{
  position: absolute;
  z-index: 1;
  width: 228px;
@@ -955,7 +966,7 @@
  margin-top: -45px;
  margin-left: 355px;
}
#overlayc{
#overlaya{
  position: absolute;
  z-index: 1;
  width: 228px;