ZengTao
5 天以前 b8a043314eb644f45e3e110c75c29b19218c2ae8
UI-Project/src/views/hollow/hollowequipment.vue
@@ -132,7 +132,7 @@
        {{ $t('reportmanage.inquire') }}</el-button>
    </div>
    <div style="margin-left: 87%;">{{ $t('hellow.pairsnumbertotal') }}{{ pairTotal }}</div>
    <el-table ref="table" style="margin-top: 20px; height: 700px;" :data="tableDatab"
    <el-table ref="table" style="margin-top: 20px; height: 650px;" :data="tableDatab"
      :row-class-name="tableRowClassName" :header-cell-style="{ background: '#F2F3F5', color: '#1D2129' }"
      row-key="projectNumber">
      <el-table-column>
@@ -714,6 +714,12 @@
                :value="item.formulaName" />
            </el-select>
          </el-form-item>
            <el-form-item :label="$t('hellow.coatingtypes')" style="width: 25vw;">
            <el-select v-model="selectedFilmRemove" filterable clearable :placeholder="$t('basicData.selectcoatingtypes')"
              style="width: 270px">
              <el-option v-for="item in filmRemoveList" :key="item" :label="item" :value="item" />
            </el-select>
          </el-form-item>
        </el-form>
      </el-form>
    </div>
@@ -746,6 +752,12 @@
                :value="item.formulaName" />
            </el-select>
          </el-form-item>
          <el-form-item :label="$t('hellow.coatingtypes')" style="width: 25vw;">
            <el-select v-model="selectedFilmRemove" filterable clearable :placeholder="$t('basicData.selectcoatingtypes')"
              style="width: 270px">
              <el-option v-for="item in filmRemoveList" :key="item" :label="item" :value="item" />
            </el-select>
          </el-form-item>
        </el-form>
      </el-form>
    </div>
@@ -759,47 +771,11 @@
    </template>
  </el-dialog>
  <!-- 缺片详情 -->
  <el-dialog v-model="dialogFormVisibleb" top="7vh" width="70%" height="500">
  <div v-loading="isLoading" class="loading-container" :element-loading-text="$t('searchOrder.loadingText')" >
    <div style="margin-top: -20px;text-align: center;margin-left: 400px;">
      <el-form-item :label="$t('hellow.cardnumbera')" style="width: 14vw">
        {{ currentRow.flowCardId }}
      </el-form-item>
    </div>
    <el-table ref="table" style="margin-top: 20px;height: 400px;" :data="tableDatac"
      :header-cell-style="{ background: '#F2F3F5 ', color: '#1D2129' }">
      <el-table-column prop="flowCardId" align="center" :label="$t('hellow.flowCardId')" min-width="100" />
      <el-table-column prop="glassId" align="center" :label="$t('searchOrder.glassID')" min-width="100" />
      <el-table-column prop="layer" align="center" :label="$t('hellow.layer')" min-width="80" />
      <el-table-column prop="glassType" align="center" :label="$t('reportmanage.number')" min-width="80" />
      <el-table-column prop="thickness" align="center" :label="$t('hellow.thickness')" min-width="80" />
      <el-table-column prop="filmsId" align="center" :label="$t('hellow.coatingtypes')" min-width="80" />
      <el-table-column prop="height" align="center" :label="$t('hellow.height')" min-width="80" />
      <el-table-column prop="width" align="center" :label="$t('hellow.width')" min-width="80" />
      <el-table-column prop="thickness" align="center" :label="$t('hellow.thickness')" min-width="80" />
      <el-table-column prop="workingProcedure" align="center" :label="$t('reportmanage.process')" min-width="80" />
      <el-table-column fixed="right" :label="$t('searchOrder.operate')" align="center">
            <template #default="scope">
              <el-button type="text" plain :disabled="scope.row.glassId==null"  @click="handleBroke(scope.row)">{{ $t('order.dilapidation') }}{{  }}</el-button>
            </template>
      </el-table-column>
      <div style="float: right;margin-bottom: 5px;">
        <el-pagination layout="prev, pager, next" :total="50" />
      </div>
    </el-table>
      <div class="custom-page-buttons">
      <button
        v-for="page in pageList"
      :key="page"
        @click="switchPage(page)"
        :class="{ 'active-page': currentPage === page }"
        class="page-btn"
      >
        {{ page }}
      </button>
    </div>
    </div>
  </el-dialog>
<LackDetailDialog
  v-model="dialogFormVisibleb"
  :flow-card-id="currentRow.flowCardId"
  @refresh-data="fetchFlowCardId"
/>
  <!-- 开始任务 -->
  <el-dialog v-model="blinda" top="30vh" width="25%" :title="$t('hellow.pstarttask')">
    <template #footer>
@@ -995,23 +971,24 @@
import { onBeforeUnmount, onMounted, onUnmounted, ref, reactive, watch, computed, getCurrentInstance ,toRaw } from "vue";
import request from "@/utils/request"
import { closeWebSocket, initializeWebSocket } from '@/utils/WebSocketService';
import LackDetailDialog from './LackDetailDialog.vue';
import { useI18n } from 'vue-i18n'
const { t } = useI18n()
const blinda = ref(false)
const blindb = ref(false)
const blindc = ref(false)
const mulan = ref(false)
const isLoading = ref(true)
const activeTab = ref('')
const tabList = ref([])
const internalInstance = getCurrentInstance()
const tableDataa = ref([])
const tableDatab = ref([])
const tableDatac = ref([])
const tableDatax = ref([])
const filmRemoveList = ref([])
const selectedFilmRemove = ref('')
const cell = ref('')
const cella = ref('')
const selectedProjectNo = ref('');
const selectedProjectNo = ref
const totalPairQuantity = ref('')
const totalPairQuantitya = ref('')
const bottomRemove = ref('')
@@ -1046,8 +1023,6 @@
const intervalFrameWidthFour = ref('')
const sealInsert = ref('')
const totalPages = ref(0)
const pageList = ref([]);
const allData = ref({});
const currentData = ref([]);
const flowCardId = ref('')
const freeone = ref('#911005');
@@ -1059,7 +1034,7 @@
const isSubmitting = ref(false)
const add = ref(false)
const adda = ref(false)
const currentRow = reactive({});
const currentRow = reactive({ flowCardId: '' });
const formattedProcessType = ref([]);
const selectedFormulaName = ref('');
const pairTotal = ref();
@@ -1068,6 +1043,7 @@
const titleformulaName = ref({ formulaName: [], formulaId: [] });
const titleSelectJson = ref({ processType: [] });
const iframeUrl = ref('');
const handlehistorical = (row) => {
  blindb.value = true;
  iframeUrl.value = `${window.location.origin}/#/hollow/hellowquiphistory`;
@@ -1387,18 +1363,21 @@
};
// 缺片详情
const handleBindRack = (row) => {
  let currentPageLack = window.localStorage.getItem('currentPageLack')
  const { flowCardId } = row;
  currentRow.flowCardId = row.flowCardId;
  isLoading.value = true;
  dialogFormVisibleb.value = true;
  fetchFlowBind(currentRow.flowCardId);
};
// 领取任务
const handletake = (row) => {
  window.localStorage.setItem('flowCardId', row.flowCardId)
  dialogFormVisiblec.value = true;
  isSubmitting.value = false
  if (row.flowCardGlassInfoDTOList && row.flowCardGlassInfoDTOList.length) {
    const films = row.flowCardGlassInfoDTOList.map(item => item.filmsId).filter(Boolean)
    // 去重
    filmRemoveList.value = [...new Set(films)]
  } else {
    filmRemoveList.value = []
  }
  fetchmulan()
};
// 强制出片
@@ -1406,41 +1385,14 @@
  window.localStorage.setItem('flowCardId', row.flowCardId)
  dialogFormVisibled.value = true;
  fetchmulan()
};
// 缺片详情-破损
const handleBroke = async (row) => {
  try {
     const confirmResult = await ElMessageBox.confirm(
      t('searchOrder.broke'),
      t('workOrder.prompt'),
      {
        confirmButtonText: t('workOrder.yes'),
        cancelButtonText: t('workOrder.cancel'),
        type: 'warning',
      }
    );
    const response = await request.post('/hollowGlass/hollowGlassRelationInfo/hollowBigStorageGlassDamage', {
      flowCardId: row.flowCardId,
      glassType: row.glassType,
      glassId: row.glassId,
      layer: row.layer,
      state: 8,
      line: 1,
      workingProcedure: '中空',
      remark: '中空'
    })
    if (response.code == 200) {
      ElMessage.success(response.message);
      const { flowCardId } = row;
      fetchFlowBind(currentRow.flowCardId);
      fetchFlowCardId()
    } else {
      ElMessage.error(response.msg);
    }
  } catch (error) {
    console.error(error);
  if (row.flowCardGlassInfoDTOList && row.flowCardGlassInfoDTOList.length) {
    const films = row.flowCardGlassInfoDTOList.map(item => item.filmsId).filter(Boolean)
    // 去重
    filmRemoveList.value = [...new Set(films)]
  } else {
    filmRemoveList.value = []
  }
}
};
// 创建任务
const fetchFlowCardId = async () => {
  try {
@@ -1735,31 +1687,6 @@
    };
  });
};
const fetchFlowBind = async (flowCardId) => {
  try {
    const url = `/hollowGlass/hollowGlassRelationInfo/queryLackByFlowCard?flowCardId=${flowCardId}`;
    const response = await request.post(url);
    if (response.code === 200) {
      isLoading.value = false;
      allData.value = response.data;
    // 提取并排序页码
    pageList.value = Object.keys(response.data)
      .map(Number)
      .sort((a, b) => a - b);
    // 初始化第一页数据
    currentPage.value = pageList.value[0];
    tableDatac.value = response.data[pageList.value[0]] || [];
    } else {
    }
  } catch (error) {
  }
};
// 页面切换处理
const switchPage = (page) => {
  currentPage.value = page;
  tableDatac.value = allData.value[page] || []; // 切换数据
};
// 开始任务
const handlea = async () => {
  try {
@@ -1823,14 +1750,16 @@
  let flowCardId = window.localStorage.getItem('flowCardId')
  let id = window.localStorage.getItem('id')
  try {
    var url = "/hollowGlass/hollowGlassOutRelationInfo/receiveTask?cell=" + 930 + "&flowCardId=" + flowCardId + "&totalPairQuantity=" + totalPairQuantity.value + "&formulaId=" + id;
    const url = `/hollowGlass/hollowGlassOutRelationInfo/receiveTask?cell=${930}&flowCardId=${flowCardId}&totalPairQuantity=${totalPairQuantity.value}&formulaId=${id}&filmRemove=${selectedFilmRemove.value}`
    const response = await request.post(url)
    if (response.code == 200) {
      ElMessage.success(response.message);
      dialogFormVisiblec.value = false;
      cell.value = '';
      formulaName.value = '';
      totalPairQuantity.value = '';
      cell.value = ''
      selectedFormulaName.value = ''
      totalPairQuantity.value = ''
      selectedFilmRemove.value = ''
      isSubmitting.value = true
    } else {
      ElMessage.error(response.message);
@@ -1853,13 +1782,14 @@
    return
  }
  try {
    var url = "/hollowGlass/hollowGlassOutRelationInfo/forceOutGlass?cell=" + 930 + "&flowCardId=" + flowCardId + "&totalPairQuantity=" + totalPairQuantitya.value + "&formulaId=" + id;
    var url = "/hollowGlass/hollowGlassOutRelationInfo/forceOutGlass?cell=" + 930 + "&flowCardId=" + flowCardId + "&totalPairQuantity=" + totalPairQuantitya.value + "&formulaId=" + id + "&filmRemove=" + selectedFilmRemove.value;
    const response = await request.post(url)
    if (response.code == 200) {
      ElMessage.success(response.message);
      dialogFormVisibled.value = false;
      cella.value = '';
      totalPairQuantitya.value = '';
      selectedFilmRemove.value = '';
    } else {
    }
  } catch (error) {