wangfei
2025-10-22 0f8bbbb24b04968cf0c5f3e9cb3ff2efde14b10f
报工页面更改为分页,新增状态为完工时不可点击报工按钮
1个文件已修改
38 ■■■■ 已修改文件
UI-Project/src/views/ReportWork/reportWork.vue 38 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UI-Project/src/views/ReportWork/reportWork.vue
@@ -27,7 +27,7 @@
      </el-select>
      <el-button type="primary" style="margin-left: 10px;" @click="selectReportData()">{{ $t('reportmanage.inquire')
        }}</el-button>
      <el-button type="success" style="margin-left: 10px;" :disabled="(!selectedStatus)" @click="handleConfirm">{{
      <el-button type="success" style="margin-left: 10px;" :disabled="isConfirmDisabled" @click="handleConfirm">{{
        $t('reportmanage.signingwork')
        }}</el-button>
    </div>
@@ -163,8 +163,9 @@
import { useI18n } from 'vue-i18n'
import { inject } from 'vue';
const globalDate = inject('globalDate');
const currentPage = ref(1)
const totalRecords = ref(0)
const pageSize = ref(20)
const currentPage = ref(1)
const { t } = useI18n()
const timeRange = ref([])
const reportData = ref([])
@@ -187,9 +188,14 @@
  status: '1',
  workingProcedure: '0',
});
const isConfirmDisabled = computed(() => {
  return report.value.type === '1' || !selectedStatus.value;
});
// 查询数据
const selectReportData = async () => {
  const response = await request.post("/cacheVerticalGlass/damage/selectDamage", {
    pageNo: currentPage.value,
    pageSize: pageSize.value,
    startTime: (timeRange.value && timeRange.value[0]) || '',
    endTime: (timeRange.value && timeRange.value[1]) || '',
    type: report.value.type,
@@ -207,23 +213,16 @@
    selectedStatus.value = false;
  }
  if (response.code === 200) {
    const formattedData = response.data.map(record => ({
    const formattedData = response.data.records.map(record => ({
        ...record,
        formattedCreateTime: formatTimestamp(record.damageTime),
      }));
    reportData.value = formattedData;
    ElMessage.success(response.message);
    totalRecords.value = response.data.total || 0
  } else {
    ElMessage.error(response.message);
  }
  // const responses = await request.post("/cacheVerticalGlass/damage/insertDamage", {
  //   glassId:"P24081502|1|1",
  //   line:"1001",
  //   workingProcedure:"切割",
  //   remark:"",
  //   status:"0"
  // })
};
// 报工
const handleConfirm = async () => {
@@ -267,10 +266,8 @@
  }
};
const handlePageChange = (newPage) => {
currentPage.value = newPage;
window.localStorage.setItem('pagenumber', currentPage.value)
historicala(currentPage.value);
Dailya(currentPage.value);
  currentPage.value = newPage;
  selectReportData();
};
const handleInputChangea = (value, rowId) => {
  // 更新对应行的 select 值  
@@ -282,17 +279,21 @@
  inputValuesa[rowId] = value;
  inputValuesb[rowId] = value;
};
fetchTableData();
// fetchTableData();
function gettypeType(type: number) {  
  switch (type) {
    case 9:
    case 1:
      return 'success';  
    case 8:
    case 9:
      return 'danger';  
    case 8:
      return 'warning';
  }
}  
function gettypeText(type: number) {
  switch (type) {
    case 1:
      return t('reportmanage.completed');
    case 9:  
      return t('reportmanage.takeout'); 
    case 8:  
@@ -359,6 +360,7 @@
onMounted(() => {
  fetchTableData();
  parseAndSetTime();
  selectReportData()
  // socket = initializeWebSocket(socketUrl, handleMessage);
});
onUnmounted(() => {