huang
2025-10-20 23f026fbfd81066b1f2e9662bbeff31965dda4d6
UI-Project/src/views/GlassStorage/rawfilmstorage2.vue
@@ -56,7 +56,6 @@
const card35 = ref(false)
const card36 = ref(false)
const card37 = ref(false)
const card38 = ref(false)
const card40 = ref(false)
const card41 = ref(false)
@@ -69,6 +68,7 @@
const card48 = ref(false)
const card49 = ref(false)
const card38 = ref(false)
const card101 = ref(false)
const timeRange = ref([])
@@ -83,18 +83,16 @@
const slot = ref('');
const leftingStation = ref('');
const loadingline = ref('');
const rawTableData = ref([]);
let webSocket: WebSocket | null = null;
const globalDate = inject('globalDate');
const value = ref('')
const options = [
  {
    value: 98,
    value: 99,
    label: t('film.warehousing1'),
  },
  {
    value: 99,
    label: t('film.warehousing2'),
  }
]
const report = ref({
  taskType: '',
@@ -121,8 +119,10 @@
  window.localStorage.setItem('startTime', formatTimestamp(oneWeekAgo))
}
onMounted(() => {
  console.log("onMounted 钩子已触发");
  socket = initializeWebSocket(socketUrl, handleMessage);
  parseAndSetTime();
  getListRawGlassTask();
});
let socket = null;
const socketUrl = `ws://${WebSocketHost}:${host}/api/glassStorage/api/talk/rawGlass`;
@@ -133,6 +133,7 @@
    }
    return task;
  });
  rawTableData.value = formattedTasks;
  tableDataa.value = formattedTasks;
  if (data.rawStationDetailsList != null) {
    tableDatab.value = data.rawStationDetailsList[0]
@@ -242,40 +243,42 @@
    if (data.rawStationDetailsList[0][34].patternThickness != null) {
      card37.value = true
    }
    if (data.rawStationDetailsList[0][35].patternThickness != null) {
      card38.value = true
    }
    if (data.rawStationDetailsList[0][36].patternThickness != null) {
      card40.value = true
    }
    if (data.rawStationDetailsList[0][37].patternThickness != null) {
    if (data.rawStationDetailsList[0][36].patternThickness != null) {
      card41.value = true
    }
    if (data.rawStationDetailsList[0][38].patternThickness != null) {
    if (data.rawStationDetailsList[0][37].patternThickness != null) {
      card42.value = true
    }
    if (data.rawStationDetailsList[0][39].patternThickness != null) {
    if (data.rawStationDetailsList[0][38].patternThickness != null) {
      card43.value = true
    }
    if (data.rawStationDetailsList[0][40].patternThickness != null) {
    if (data.rawStationDetailsList[0][39].patternThickness != null) {
      card44.value = true
    }
    if (data.rawStationDetailsList[0][41].patternThickness != null) {
    if (data.rawStationDetailsList[0][40].patternThickness != null) {
      card45.value = true
    }
    if (data.rawStationDetailsList[0][42].patternThickness != null) {
    if (data.rawStationDetailsList[0][41].patternThickness != null) {
      card46.value = true
    }
    if (data.rawStationDetailsList[0][43].patternThickness != null) {
    if (data.rawStationDetailsList[0][42].patternThickness != null) {
      card47.value = true
    }
    if (data.rawStationDetailsList[0][44].patternThickness != null) {
    if (data.rawStationDetailsList[0][43].patternThickness != null) {
      card48.value = true
    }
    if (data.rawStationDetailsList[0][45].patternThickness != null) {
    if (data.rawStationDetailsList[0][44].patternThickness != null) {
      card49.value = true
    }
    if (data.rawStationDetailsList[0][45].patternThickness != null) {
      card38.value = true
    }
    if (data.rawStationDetailsList[0][46].patternThickness != null) {
@@ -297,6 +300,39 @@
const handleBinde = (row) => {
  dialogFormVisiblee.value = true;
};
// 查询原片仓储任务详情
const getListRawGlassTask = async (row) => {
  try {
    console.log("[getListRawGlassTask] 函数已被调用,开始执行");
    var url = "/glassStorage/rawGlassStorageTask/listRawGlassTask";
    const response = await request.post(url)
    if (response.code === 200) {
      ElMessage.success(response.message);
      // 更新tableDataa数据
      if (response.data && response.data.tasks && response.data.tasks[0]) {
        const formattedTasks = response.data.tasks[0].map(task => {
          if (task && task.createTime) {
            return { ...task, createTime: formatTimestamp(task.createTime) };
          }
          return task;
        });
        rawTableData.value = formattedTasks;
        tableDataa.value = formattedTasks;
      }
      // 更新tableDatab数据,确保页面能及时显示任务
      if (response.data && response.data.rawStationDetailsList && response.data.rawStationDetailsList[0]) {
        tableDatab.value = response.data.rawStationDetailsList[0];
      }
    } else {
      ElMessage.error(response.msg);
    }
  } catch (error) {
    console.error('查询原片仓储任务详情失败:', error);
  }
};
// 删除 
const deleteWarehousing = async (row) => {
  try {
@@ -355,14 +391,18 @@
    const response = await request.post(url)
    if (response.code == 200) {
      ElMessage.success(response.message);
      dialogFormVisiblec.value = false;
      leftingStation.value = '';
      // 调用获取任务详情的接口,确保数据及时更新
      await getListRawGlassTask();
      dialogFormVisiblec.value = false;
    } else {
      // 请求失败,显示错误消息
      ElMessage.error(response.msg);
    }
  }
  catch (error) {
    dialogFormVisiblec.value = false;
    console.error('入库请求失败:', error);
  }
}
// 出库请求
@@ -408,33 +448,36 @@
  }
};
// 查询数据
const selectReportData = async () => {
  let celllist = []
  let stateList = []
  if (selectValuesa[0] != null && selectValuesa[0] != 'undefined') {
    if (selectValuesa[0] != "") {
      celllist = [selectValuesa[0]];
    }
const selectReportData = () => {
  // 处理查询条件
  const [taskStateVal, taskTypeVal] = selectValuesa;
  const beginDate = timeRange.value?.[0] || '';
  const endDate = timeRange.value?.[1] || '';
  let filteredData = [...rawTableData.value];
  if (beginDate) {
    const beginTime = new Date(beginDate).getTime();
    filteredData = filteredData.filter(item => new Date(item.createTime).getTime() >= beginTime);
  }
  if (selectValuesa[1] != null && selectValuesa[1] != 'undefined') {
    if (selectValuesa[1] != "") {
      stateList = [selectValuesa[1]];
    }
  if (endDate) {
    const endTime = new Date(endDate).getTime();
    filteredData = filteredData.filter(item => new Date(item.createTime).getTime() <= endTime);
  }
  const response = await request.post("/glassStorage/rawGlassStorageTask/setRawGlassTaskRequest", {
    beginDate: (timeRange.value && timeRange.value[0]) || '',
    endDate: (timeRange.value && timeRange.value[1]) || '',
    taskState: celllist,
    taskType: stateList
  })
  if (response.code === 200) {
    // tableDataa.value = response.data;
    ElMessage.success(response.message);
  if (taskStateVal != null && taskStateVal !== 'undefined' && taskStateVal !== '') {
    filteredData = filteredData.filter(item => item.taskState.toString() === taskStateVal);
  }
  else {
    ElMessage.error(response.message);
  if (taskTypeVal != null && taskTypeVal !== 'undefined' && taskTypeVal !== '') {
    filteredData = filteredData.filter(item => item.taskType.toString() === taskTypeVal);
  }
  tableDataa.value = filteredData;
  ElMessage.success(`查询成功,共 ${filteredData.length} 条数据`);
};
// 是否禁用
const toggleEnableState = async (row: any) => {
  if (!row.deviceId) {
@@ -589,7 +632,7 @@
function getStatusText1(taskType) {
  switch (taskType) {
    case 1:
      return t('sorter.advancetask');//进片任务
      return t('sorter.warehouseReturntasks');//回库任务
    case 2:
      return t('sorter.outputtasks');//出片任务
    case 3:
@@ -597,27 +640,31 @@
    case 4:
      return t('sorter.advancerequests');//进片请求
    case 5:
      return t('sorter.releaserequest');//出片请求
      return t('sorter.warehouseReturntasks');//回库请求
  }
}
function getStatusType2(taskState) {
  switch (taskState) {
    case 0:
      return 'info';
    case 2:
      return 'warning';
    case 1:
      return 'warning';
    case 2:
      return 'success';
    case 3:
      return 'danger';
  }
}
function getStatusText2(taskState) {
  switch (taskState) {
    case 0:
      return t('film.built');//新建
    case 2:
      return t('film.fail');//失败
    case 1:
      return t('film.execution');//执行中
    case 2:
      return t('film.finish');//完成
    case 3:
      return t('film.fail');//失败
  }
}
onBeforeUnmount(() => {
@@ -634,10 +681,10 @@
        {{ $t('film.warehousing') }}
      </el-button>
      <el-button style="margin-left: 20px;" id="searchButton" type="success" @click="handleBindc">
        {{ $t('film.pwarehousing') }}
        {{ $t('film.emptyShelfPosition') }}
      </el-button>
      <el-button style="margin-left: 20px;" id="searchButton" type="success" @click="handleBinde">{{
        $t('film.pwareout')
        $t('film.warehouseReturn')
      }}
      </el-button>
      <el-button style="margin-left: 20px;" id="searchButton" type="success" @click="handlehistorical">{{
@@ -647,17 +694,18 @@
      <el-date-picker style="margin-left: 10px;" v-model="timeRange" type="datetimerange" format="YYYY/MM/DD HH:mm:ss"
        value-format="YYYY-MM-DD HH:mm:ss" :start-placeholder="$t('film.starttime')"
        :end-placeholder="$t('film.endtime')" :default-time="defaultTime" />
      <el-select v-model="selectValuesa[0]" clearable :placeholder="$t('film.taskstatus')" style="margin-left: 10px;">
      <el-select v-model="selectValuesa[0]" clearable :placeholder="$t('film.taskstatus')" style="margin-left: 10px; width: 200px;">
        <el-option :label="$t('film.built')" value="0"></el-option>
        <el-option :label="$t('film.finish')" value="1"></el-option>
        <el-option :label="$t('film.fail')" value="2"></el-option>
        <el-option :label="$t('film.execution')" value="1"></el-option>
        <el-option :label="$t('film.finish')" value="2"></el-option>
        <el-option :label="$t('film.fail')" value="3"></el-option>
      </el-select>
      <el-select v-model="selectValuesa[1]" clearable :placeholder="$t('film.tasktype')" style="margin-left: 10px;">
        <el-option :label="$t('sorter.advancetask')" value="1"></el-option>
      <el-select v-model="selectValuesa[1]" clearable :placeholder="$t('film.tasktype')" style="margin-left: 10px; width: 200px;">
        <el-option :label="$t('sorter.warehouseReturntasks')" value="1"></el-option>
        <el-option :label="$t('sorter.outputtasks')" value="2"></el-option>
        <el-option :label="$t('sorter.schedulingtasks')" value="3"></el-option>
        <el-option :label="$t('sorter.advancerequests')" value="4"></el-option>
        <el-option :label="$t('sorter.releaserequest')" value="5"></el-option>
        <el-option :label="$t('sorter.warehouseReturntasks')" value="5"></el-option>
      </el-select>
      <el-button type="primary" style="margin-left: 10px;" @click="selectReportData()">{{ $t('film.inquire')
      }}</el-button>
@@ -687,9 +735,9 @@
          <el-table-column prop="createTime" align="center" :label="$t('film.createtime')" />
          <el-table-column fixed="right" :label="$t('film.operate')" align="center">
            <template #default="scope">
              <el-button :disabled="(scope.row.taskState !== 0)" type="text" plain @click="successfull(scope.row)">{{
              <el-button :disabled="(scope.row.taskState == 0 && scope.row.taskType == 1)" type="text" plain @click="successfull(scope.row)">{{
                $t('searchOrder.successfullyprocessed') }}</el-button>
              <el-button :disabled="(scope.row.taskState !== 0)" type="text" plain @click="handleptask(scope.row)">{{
              <el-button :disabled="(scope.row.taskState == 0 && scope.row.taskType == 1)" type="text" plain @click="handleptask(scope.row)">{{
                $t('searchOrder.taskfailure') }}</el-button>
            </template>
          </el-table-column>
@@ -728,7 +776,7 @@
        <div class="card25" v-show="card25" style="z-index:999;"></div>
        <div class="card26" v-show="card26" style="z-index:999;"></div>
        <div class="card27" v-show="card27" style="z-index:999;"></div>
        <div class="card28" v-show="card28" style="z-index:999;"></div>
        <div class="card28" v-show="card28" style="z-index:999;position:absolute;"></div>
      </div>
      <div class="glasscard2">
        <div class="card31" v-show="card31" style="z-index:999;"></div>
@@ -759,7 +807,7 @@
    <el-dialog v-model="dialogFormVisiblea" top="5vh" width="85%">
      <el-table ref="table" style="margin-top: 20px;height: 700px;" :data="tableDatab"
        :header-cell-style="{ background: '#F2F3F5 ', color: '#1D2129' }">
        <el-table-column prop="deviceId" fixed align="center" :label="$t('film.station')" min-width="80" />
        <!-- <el-table-column prop="deviceId" fixed align="center" :label="$t('film.station')" min-width="80" /> -->
        <el-table-column prop="slot" fixed align="center" :label="$t('film.slot')" min-width="80" />
        <el-table-column prop="patternWidth" align="center" :label="$t('film.width')" min-width="80" />
        <el-table-column prop="patternHeight" align="center" :label="$t('film.height')" min-width="80" />
@@ -867,12 +915,11 @@
        </div>
      </template>
    </el-dialog>
    <el-dialog v-model="dialogFormVisiblec" top="24vh" width="30%" :title="$t('film.pwarehousing')">
    <el-dialog v-model="dialogFormVisiblec" top="24vh" width="30%" :title="$t('film.emptyShelfPosition')">
      <div style="margin-left: 50px;margin-bottom: 10px;">
        <el-form-item :label="$t('film.position')" :required="true">
          <el-select v-model="leftingStation" clearable :placeholder="$t('film.cposition')" style="margin-left: 20px;">
            <el-option :label="$t('film.position1')" value="98"></el-option>
            <el-option :label="$t('film.position2')" value="99"></el-option>
            <el-option :label="$t('film.position1')" value="99"></el-option>
          </el-select>
        </el-form-item>
      </div>
@@ -885,12 +932,11 @@
        </div>
      </template>
    </el-dialog>
    <el-dialog v-model="dialogFormVisiblee" top="24vh" width="30%" :title="$t('film.pwareout')">
    <el-dialog v-model="dialogFormVisiblee" top="24vh" width="30%" :title="$t('film.warehouseReturn')">
      <div style="margin-left: 50px;margin-bottom: 10px;">
        <el-form-item :label="$t('film.position')" :required="true">
          <el-select v-model="leftingStation" clearable :placeholder="$t('film.cposition')" style="margin-left: 20px;">
            <el-option :label="$t('film.position1')" value="98"></el-option>
            <el-option :label="$t('film.position2')" value="99"></el-option>
            <el-option :label="$t('film.position1')" value="99"></el-option>
          </el-select>
        </el-form-item>
      </div>
@@ -1002,15 +1048,15 @@
}
.img-dlpl {
  margin-left: 360px;
  margin-left: 38px;
  margin-top: 15px;
  background-image: url('../../assets/cangchu2.png');
  background-repeat: no-repeat;
  background-attachment: local;
  min-height: 800px;
  width: 800px;
  width: 1070px;
  max-width: 100%;
  background-size: 1020px 590px;
  background-size: 1500px 810px;
  overflow: hidden;
  position: relative;
}
@@ -1021,251 +1067,320 @@
  position: absolute;
  background-repeat: no-repeat;
  background-attachment: local;
  min-height: 200px;
  min-height: 242px;
  width: 240px;
  max-width: 100%;
  background-size: 270px 250px;
  background-size: 270px 327px;
  overflow: hidden;
  position: relative;
  margin-left: 527px;
  margin-top: 6px
  margin-left: 866px;
  margin-top: 107px
}
.glasscard1 {
  height: 200px;
  display: flex;
  gap: 5px;
  margin-top: 445px;
  margin-left: 335px;
  height: 118px;
  position: relative;
  margin-top: 625px;
  margin-left: 493px;
}
.card1 {
  width: 8px;
  height: 95px;
  background-color: #911005
  background-color: #911005;
  position: absolute;
  left: 0;
}
.card2 {
  width: 8px;
  height: 95px;
  background-color: #911005
  background-color: #911005;
  position: absolute;
  left: 19px;
}
.card3 {
  width: 8px;
  height: 95px;
  background-color: #911005
  background-color: #911005;
  position: absolute;
  left: 38px;
}
.card4 {
  width: 8px;
  height: 95px;
  background-color: #911005
  background-color: #911005;
  position: absolute;
  left: 57px;
}
.card5 {
  width: 8px;
  height: 95px;
  background-color: #911005
  background-color: #911005;
  position: absolute;
  left: 76px;
}
.card6 {
  width: 8px;
  height: 95px;
  background-color: #911005
  background-color: #911005;
  position: absolute;
  left: 95px;
}
.card7 {
  width: 8px;
  height: 95px;
  background-color: #911005
  background-color: #911005;
  position: absolute;
  left: 114px;
}
.card8 {
  width: 8px;
  height: 95px;
  background-color: #911005;
  position: absolute;
  left: 133px;
}
.card9 {
  width: 8px;
  height: 95px;
  background-color: #911005;
  position: absolute;
  left: 152px;
}
.card10 {
  width: 8px;
  height: 95px;
  background-color: #911005;
  position: absolute;
  left: 171px;
}
.card11 {
  width: 8px;
  height: 95px;
  background-color: #911005;
  position: absolute;
  left: 190px;
}
.card12 {
  width: 8px;
  height: 95px;
  background-color: #911005;
  position: absolute;
  left: 209px;
}
.card13 {
  width: 8px;
  height: 95px;
  background-color: #911005;
  position: absolute;
  left: 228px;
}
.card14 {
  width: 8px;
  height: 95px;
  background-color: #911005;
  position: absolute;
  left: 247px;
}
.card15 {
  width: 8px;
  height: 95px;
  background-color: #911005;
  position: absolute;
  left: 266px;
}
.card16 {
  width: 8px;
  height: 95px;
  background-color: #911005;
  position: absolute;
  left: 285px;
}
.card17 {
  width: 8px;
  height: 95px;
  background-color: #911005;
  position: absolute;
  left: 304px;
}
.card18 {
  width: 8px;
  height: 95px;
  background-color: #911005;
  position: absolute;
  left: 323px;
}
.card19 {
  width: 8px;
  height: 95px;
  background-color: #911005;
  position: absolute;
  left: 342px;
}
.card20 {
  width: 8px;
  height: 95px;
  background-color: #911005;
  position: absolute;
  left: 361px;
}
.card21 {
  width: 8px;
  height: 95px;
  background-color: #911005;
  position: absolute;
  left: 380px;
}
.card22 {
  width: 8px;
  height: 95px;
  background-color: #911005;
  position: absolute;
  left: 399px;
}
.card23 {
  width: 8px;
  height: 95px;
  background-color: #911005;
  position: absolute;
  left: 418px;
}
.card24 {
  width: 8px;
  height: 95px;
  background-color: #911005;
  position: absolute;
  left: 437px;
}
.card25 {
  width: 8px;
  height: 95px;
  background-color: #911005;
  position: absolute;
  left: 456px;
}
.card26 {
  width: 8px;
  height: 95px;
  background-color: #911005;
  position: absolute;
  left: 475px;
}
.card27 {
  width: 8px;
  height: 95px;
  background-color: #911005;
  position: absolute;
  left: 494px;
}
.card28 {
  width: 8px;
  height: 95px;
  background-color: #911005;
  position: absolute;
  left: 513px;
}
.glasscard2 {
  display: flex;
  gap: 5px;
  position: relative;
  margin-top: -420px;
  margin-left: 335px;
  margin-left: 495px;
}
.card31 {
  width: 8px;
  height: 90px;
  background-color: #911005;
  position: absolute;
  left: 0;
}
.card32 {
  width: 8px;
  height: 90px;
  background-color: #911005;
  position: absolute;
  left: 19px;
}
.card33 {
  width: 8px;
  height: 90px;
  background-color: #911005;
  position: absolute;
  left: 38px;
}
.card34 {
  width: 8px;
  height: 90px;
  background-color: #911005;
  position: absolute;
  left: 57px;
}
.card35 {
  width: 8px;
  height: 90px;
  background-color: #911005;
  position: absolute;
  left: 76px;
}
.card36 {
  width: 8px;
  height: 90px;
  background-color: #911005;
  position: absolute;
  left: 95px;
}
.card37 {
  width: 8px;
  height: 90px;
  background-color: #911005;
  position: absolute;
  left: 114px;
}
.card38 {
  width: 8px;
  height: 90px;
  background-color: #911005;
  position: absolute;
  left: 136px;
}
.glasscard3 {
  display: flex;
  gap: 5px;
  margin-left: 550px;
  position: relative;
  margin-left: 806px;
  margin-top: -90px;
}
@@ -1273,67 +1388,87 @@
  width: 8px;
  height: 90px;
  background-color: #911005;
  position: absolute;
  left: 0;
}
.card41 {
  width: 8px;
  height: 90px;
  background-color: #911005;
  position: absolute;
  left: 19px;
}
.card42 {
  width: 8px;
  height: 90px;
  background-color: #911005;
  position: absolute;
  left: 38px;
}
.card43 {
  width: 8px;
  height: 90px;
  background-color: #911005;
  position: absolute;
  left: 57px;
}
.card44 {
  width: 8px;
  height: 90px;
  background-color: #911005;
  position: absolute;
  left: 76px;
}
.card45 {
  width: 8px;
  height: 90px;
  background-color: #911005;
  position: absolute;
  left: 95px;
}
.card46 {
  width: 8px;
  height: 90px;
  background-color: #911005;
  position: absolute;
  left: 114px;
}
.card47 {
  width: 8px;
  height: 90px;
  background-color: #911005;
  position: absolute;
  left: 133px;
}
.card48 {
  width: 8px;
  height: 90px;
  background-color: #911005;
  position: absolute;
  left: 152px;
}
.card49 {
  width: 8px;
  height: 90px;
  background-color: #911005;
  position: absolute;
  left: 171px;
}
.card101 {
  width: 8px;
  height: 90px;
  background-color: #911005;
  margin-top: -90px;
  margin-left: 695px;
  position: absolute;
  left: 1023px;
}
</style>