ZengTao
2025-07-17 1d6599eb08b3a72de68cf667365f127e3691592c
UI-Project/src/views/hollow/hollowequipmenthree.vue
@@ -23,6 +23,10 @@
            $t('hellow.stopproject')
          }}
        </el-button>
        <el-button style="margin-left: 10px;" :disabled="listFlow.length > 0 ? false : true" id="searchButton" type="warning" @click="handleBinde">{{
          $t('searchOrder.printlabels')
        }}
        </el-button>
  </div>
     
    <div id="dotClass">
@@ -65,10 +69,13 @@
    <div style="display: flex;">
    <el-input v-model="flowCardId" style="margin-left: 10px;margin-bottom: 10px;width: 240px;" :placeholder="$t('searchOrder.incardnumber')" />
    <el-input v-model="filmsId" style="margin-left: 10px;margin-bottom: 10px;width: 240px;" :placeholder="$t('film.infilms')"/>
    <el-input v-model="productName" style="margin-left: 10px;margin-bottom: 10px;width: 240px;" :placeholder="$t('large.inproductname')"/>
    <el-input v-model="customerName" style="margin-left: 10px;margin-bottom: 10px;width: 240px;" :placeholder="$t('large.incustomerName')"/>
    <el-input v-model="thickness" style="margin-left: 10px;margin-bottom: 10px;width: 240px;" :placeholder="$t('searchOrder.inthickness')"/>
    <el-button type="primary" style="margin-left: 10px;margin-bottom: 10px;" @click="fetchFlowCardsearch">
      {{$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;"
@@ -88,13 +95,14 @@
      <el-table-column prop="filmsId" align="center" :label="$t('hellow.coatingtypes')" min-width="80"/>
      <el-table-column prop="sumCount" align="center" :label="$t('hellow.totalnumber')" min-width="80"/>
      <el-table-column prop="realCount" align="center" :label="$t('hellow.realpieces')" min-width="80"/>
      <el-table-column prop="pairCount" align="center" :label="$t('hellow.pairsnumber')" min-width="80"/>
      <el-table-column prop="damageCount" align="center" :label="$t('hellow.damagenumber')" min-width="80"/>
      <el-table-column prop="pairCount" align="center" :label="$t('hellow.pairsnumber')" min-width="80"/>
      </el-table>
      </template>
    </el-table-column>
    <el-table-column prop="flowCardId" fixed align="center" :label="$t('hellow.cardnumber')" min-width="20"/>
    <el-table-column prop="productName" fixed align="center" :label="$t('large.productname')" min-width="20"/>
    <el-table-column prop="customerName" fixed align="center" :label="$t('large.customerName')" min-width="20"/>
    <el-table-column fixed="right" :label="$t('hellow.operate')" align="center" width="270">
        <template #default="scope">
          <el-button type="text" :disabled="scope.row.isThroughSlot" plain @click="handletake(scope.row)">{{ $t('hellow.claimquest') }}</el-button>
@@ -360,7 +368,7 @@
  <el-dialog v-model="dialogFormVisibleb" top="7vh" width="70%" height="500">
    <div style="margin-top: -20px;text-align: center;margin-left: 400px;">
      <el-form-item :label="$t('hellow.cardnumbera')" style="width: 14vw">
        {{ currentRow.projectNumber }}
        {{ currentRow.flowCardId }}
      </el-form-item>
    </div>
    <el-table ref="table" style="margin-top: 20px;height: 400px;"
@@ -409,6 +417,30 @@
      </div>
    </template>
  </el-dialog>
  <!-- 打印标签 -->
    <el-dialog v-model="blinde" top="30vh" width="25%" :title="$t('searchOrder.printlabels')">
      <template #footer>
        <div id="dialog-footer">
          <el-select v-model="tag" filterable clearable :placeholder="$t('hellow.projectMsg2')" @change="changeTag"
            style="width: 220px" @input="handleInputChange">
            <el-option v-for="(tag, index) in tags" :key="index" :label="tag.name" :value="tag" />
          </el-select>
          <el-select v-model="stateValue" filterable clearable :placeholder="$t('screendisplay.pchoice')"
            style="width: 220px" @input="handleInputChange">
            <el-option v-for="item in stateOptions" :key="item.value" :label="item.label" :value="item.value" />
          </el-select>
          <el-button type="primary" @click="labelPrint = true">
            {{ $t('processCard.printing') }}
          </el-button>
          <el-button @click="blinde = false">{{ $t('basicData.cancel') }}</el-button>
        </div>
      </template>
    </el-dialog>
    <el-dialog v-model="labelPrint" style="width: 80%; " destroy-on-close>
      <el-button :icon="Printer" circle @click="printOrder(1)">{{ $t('processCard.printing') }}</el-button>
      <print-custom-label-x-j id="childLabel" :faceOrientation="stateValue" :lableType="1" :list="listFlow"
        :lastList='lastList' :type="tag.name" style="width: 100%;height: 100%" />
    </el-dialog>
  <!-- 删除任务 -->
  <el-dialog v-model="blindd" top="30vh" width="25%" :title="$t('hellow.hollowtaskdet')">
    <template #footer>
@@ -428,7 +460,7 @@
            v-model="selectedProjectNo"
            filterable
            clearable
            :placeholder="$t('basicData.plselectproject')"
            :placeholder="$t('hellow.plselectproject')"
            style="width: 260px"
        >
          <el-option
@@ -524,6 +556,9 @@
const topRemove = ref('')
const filmsId = ref('')
const flowCardId = ref('')
const pairTotal = ref()
const productName = ref('')
const customerName = ref('')
const freethree = ref('#911005');
const dialogFormVisiblea = ref(false)
const dialogFormVisibleb = ref(false)
@@ -570,7 +605,7 @@
};
const handlePageChange2 = (newPage) => {
  currentPage2.value = newPage;
  fetchFlowBind(currentRow.projectNumber, currentRow.layer, currentPage2.value);
  fetchFlowBind(currentRow.flowCardId, currentPage2.value);
};
const handleMessage = (data) => {
  try {
@@ -664,20 +699,20 @@
// 缺片详情
const handleBindRack = (row) => {
  currentPage2.value = 1;
  const { projectNumber, layer } = row;
  currentRow.projectNumber  = row.projectNumber;
  const { flowCardId} = row;
  currentRow.flowCardId  = row.flowCardId;
  dialogFormVisibleb.value = true;
  fetchFlowBind(projectNumber, layer,currentPage2.value);
  fetchFlowBind(flowCardId, currentPage2.value);
};
// 领取任务
const handletake = (row) => {
  window.localStorage.setItem('flowCardId', row.projectNumber)
  window.localStorage.setItem('flowCardId', row.flowCardId)
  dialogFormVisiblec.value = true;
  fetchmulan()
};
// 强制出片
const handleout = (row) => {
  window.localStorage.setItem('flowCardId', row.projectNumber)
  window.localStorage.setItem('flowCardId', row.flowCardId)
  dialogFormVisibled.value = true;
  fetchmulan()
};
@@ -693,11 +728,10 @@
    if (response.code == 200) {
      ElMessage.success(response.message);
      tableDatab.value = response.data;
      pairTotal.value = response.data[0].pairTotalCount;
    } else {
      ElMessage.error('Failed to fetch data');
    }
  } catch (error) {
    ElMessage.error('Error fetching data');
  }
};
function tableRowClassName({ row }) {
@@ -722,11 +756,10 @@
    if (response.code == 200) {
      ElMessage.success(response.message);
      tableDatab.value = response.data;
      pairTotal.value = response.data[0].pairTotalCount;
    } else {
      ElMessage.error('Failed to fetch data');
    }
  } catch (error) {
    ElMessage.error('Error fetching data');
  }
};
// 中空配方
@@ -739,10 +772,8 @@
      tableDatax.value = response.data;
      titleformulaName.value = response.data.map(item => ({ formulaId: item.id, formulaName: item.formulaName }));
    } else {
      ElMessage.error('Failed to fetch data');
    }
  } catch (error) {
    ElMessage.error('Error fetching data');
  }
};
const handleFormulaChange = (value) => {
@@ -777,10 +808,8 @@
      topRemove.value = '';
      fetchmulan()
    } else {
      ElMessage.error('Failed to fetch data');
    }
  } catch (error) {
    ElMessage.error('Error fetching data');
  }
};
const removalMethodMapa = {
@@ -803,10 +832,8 @@
      adda.value = false
      fetchmulan()
    } else {
      ElMessage.error('Failed to fetch data');
    }
  } catch (error) {
    ElMessage.error('Error fetching data');
  }
};
// 中空配方删除 
@@ -828,7 +855,6 @@
      ElMessage.success(response.message);
      fetchmulan()
    } else {
      ElMessage.error(response.msg);
      }  
    }  
  } catch (error) {
@@ -846,14 +872,16 @@
      }));
      titleSelectJson.value.processType = processTypes;
    } else {
      ElMessage.error('Failed to fetch data');
    }
  } catch (error) {
    ElMessage.error('Error fetching data');
  }
};
// 预览
const handleup = async () => {
  if (!selectedProjectNo.value) {
    ElMessage.error(t('hellow.plselectproject'))
    return
  }
  try {
    var url="/hollowGlass/hollowGlassOutRelationInfo/appointHollowTaskDetails?cell="+ 932 + "&flowCardId=" + selectedProjectNo.value;
  window.localStorage.setItem('flowCardId', selectedProjectNo.value)
@@ -864,11 +892,21 @@
      dialogFormVisiblee.value = false
      selectedProjectNo.value = ''
      closeWebSocket(socket);
      const summary = response.data.reduce((map, item) => {
              const key = `${item.hollowSequence}`;
              if (!map[key]) {
                map[key] = {
                  printQuantity: 1,
                  order_number: item.glassType,
                  processId: item.flowCardId
                };
              }
              return map;
            }, {});
            listFlow.value = Object.values(summary);
  } else {
      ElMessage.error('Failed to fetch data');
    }
  } catch (error) {
    ElMessage.error('Error fetching data');
  }
};
const parseData = (rawData) => {
@@ -883,15 +921,14 @@
    };
  });
};
const fetchFlowBind = async (flowCardId, layer, page) => {
const fetchFlowBind = async (flowCardId, page) => {
  try {
    var url="/hollowGlass/hollowGlassRelationInfo/queryLackByFlowCard?flowCardId="+flowCardId + "&layer=" + layer;
    var url="/hollowGlass/hollowGlassRelationInfo/queryLackByFlowCard?flowCardId="+flowCardId + "&layer=" + 1;
    const response = await request.post(url)
    if (response.code == 200) {
      tableDatac.value = response.data[page];
      ElMessage.success(response.message);
    } else {
      ElMessage.error(response.message);
    }
  } catch (error) {
  }
@@ -907,7 +944,6 @@
        ElMessage.success(response.message);
        blinda.value = false;
      } else {
        ElMessage.error(response.message);
      }
    } else {
      ElMessage({
@@ -929,7 +965,6 @@
        ElMessage.success(response.message);
        blindc.value = false;
      } else {
        ElMessage.error(response.message);
      }
    } else {
      ElMessage({
@@ -951,7 +986,6 @@
        ElMessage.success(response.message);
        blindd.value = false;
      } else {
        ElMessage.error(response.message);
      }
    } else {
      ElMessage({
@@ -966,6 +1000,10 @@
const finisha = async () => {
  let flowCardId = window.localStorage.getItem('flowCardId')
  let id = window.localStorage.getItem('id')
  if (!totalPairQuantity.value) {
    ElMessage.error(t('hellow.cpairQuantity'))
    return
  }
    try {
      var url="/hollowGlass/hollowGlassOutRelationInfo/receiveTask?cell="+ 932 + "&flowCardId=" + flowCardId + "&totalPairQuantity=" + totalPairQuantity.value+ "&formulaId=" + -1;
      const response = await request.post(url)
@@ -976,7 +1014,6 @@
      formulaName.value = '';
      totalPairQuantity.value = '';
    } else {
          ElMessage.error(response.message);
        }
      } catch (error) {
      }
@@ -985,6 +1022,10 @@
const finishb = async () => {
  let flowCardId = window.localStorage.getItem('flowCardId')
  let id = window.localStorage.getItem('id')
  if (!totalPairQuantitya.value) {
    ElMessage.error(t('hellow.cpairQuantity'))
    return
  }
  try {
      var url="/hollowGlass/hollowGlassOutRelationInfo/forceOutGlass?cell="+ 932 + "&flowCardId=" + flowCardId + "&totalPairQuantity=" + totalPairQuantitya.value+ "&formulaId=" + -1;
      const response = await request.post(url)
@@ -994,7 +1035,6 @@
      cella.value = '';
      totalPairQuantitya.value = '';
    } else {
          ElMessage.error(response.message);
        }
      } catch (error) {
      }
@@ -1002,6 +1042,77 @@
onBeforeUnmount(() => {
  closeWebSocket();
});
import requestErp from "@/utils/requestErp";
import { hiprint } from "vue-plugin-hiprint";
import PrintCustomLabelXJ from './PrintCustomLabelTwo.vue'
const listFlow = ref([])
let hiprintTemplate = ref()
const stateValue = ref('')
const stateOptions = [
  {
    value: t('processCard.thisIsTheIndoorSurface'),
    label: t('processCard.thisIsTheIndoorSurface'),
  },
  {
    value: t('processCard.thisSideIsOutsideTheRoom'),
    label: t('processCard.thisSideIsOutsideTheRoom'),
  },
]
const blinde = ref(false)
const labelPrint = ref(false);
const handleBinde = (row) => {
  blinde.value = true;
  getTags();
  hiprint.init();
};
const changeTag = () => {
  hiprintTemplate.value = new hiprint.PrintTemplate({});
  const json = JSON.parse(tag.value.value)
  hiprintTemplate.value.update(json)
}
const getTags = async () => {
  try {
    const response = await requestErp.get('tagStyle/getTagList')
    if (response.code == 200) {
      tags.value = response.data
      ElMessage.success(response.message);
    }
  } catch (error) {
  }
}
const printOrder = (type) => {
  const list = hiprintTemplate.value.getJson()
  list.panels[0].printElements.forEach(element => {
    element.options.fontFamily = 'Arial'
  })
  console.log(lastList.value)
  let object = lastList.value
  //判断是否为表格
  let columnsNum = null
  if (list.panels[0].printElements[0].options.field === 'table') {
    object = { table: lastList.value }
    columnsNum = (list.panels[0].printElements[0].options.gridColumns || 1)
  }
  hiprintTemplate.value.print(object)
}
let lastList = ref([])
const tags = ref([])
const tag = ref({
  id: null,
  name: null,
  type: 1,
  tagWidth: null,
  tagHeight: null,
  value: null,
  size: null
})
</script>
<style scoped>
#dt { display:block; float:left;line-height: 20px;margin-left: 100px;}