guoyujie
6 天以前 1750abd11320f8d09ffe1580b7467dba87c86c89
north-glass-erp/northglass-erp/src/views/pp/report/WorkInProgress.vue
@@ -4,7 +4,7 @@
import {useRouter} from 'vue-router'
import request from "@/utils/request";
import deepClone from "@/utils/deepClone";
import {ElDatePicker, ElMessage} from "element-plus";
import {ElCheckbox, ElDatePicker, ElMessage} from "element-plus";
import {useI18n} from 'vue-i18n'
import footSum from "@/hook/footSum"
import {addListener} from "@/hook/mouseMove";
@@ -22,6 +22,8 @@
//工序
const valueProcess = ref()
//终止状态
let terminationVal = ref(1)
//根据以下字段汇总查询
const stateValue = ref('')
@@ -93,12 +95,7 @@
  dataTotal: 0,
  pageSize: 100
})
let newItem= ref({
  basic_name: '全部',
  basic_type: 'product',
  basic_category: 'process',
  id: "001"
})
//定义接收加载表头下拉数据
const titleSelectJson = ref({
  processType: [],
@@ -108,17 +105,16 @@
  optionVal = null
}
//第一次加载数据
request.post(`/report/workInProgress/1/${total.pageSize}/${inputVal}/${inputProject}/${selectProcesses}/${optionVal}`, filterData.value).then((res) => {
request.post(`/report/workInProgressCombinationProcess/1/${total.pageSize}/${inputVal}/${inputProject}/${selectProcesses}/${optionVal}`, filterData.value).then((res) => {
  if (res.code == 200) {
    total.dataTotal = res.data.total.total*1
    total.pageTotal= res.data.total.pageTotal
    pageTotal.value = res.data.total
    // total.dataTotal = res.data.total.total*1
    // total.pageTotal= res.data.total.pageTotal
    // pageTotal.value = res.data.total
    total.value = res.data.total
    produceList = produceList.value.concat(deepClone(res.data.data))
    //produceList = produceList.value.concat(deepClone(res.data.data))
    titleSelectJson.value.processType = res.data.process
    titleSelectJson.value.processType.splice(0,1)
    titleSelectJson.value.processType.unshift(newItem.value)
    //xGrid.value.reloadData(produceList)
    gridOptions.loading = false
  } else {
@@ -141,8 +137,13 @@
  if (optionVal == '') {
    optionVal = null
  }
  request.post(`/report/workInProgress/${pageNum.value}/${total.pageSize}/${inputVal}/${inputProject}/${selectProcesses}/${optionVal}`, filterData.value).then((res) => {
  let terminationVals = terminationVal.value
  if (terminationVals == '') {
    terminationVals = null
  }
  request.post(`/report/workInProgress/${pageNum.value}/${total.pageSize}/${inputVal}/${inputProject}/${selectProcesses}/${optionVal}/${terminationVals}`, filterData.value).then((res) => {
    if (res.code == 200) {
      total.value = res.data.total
      produceList = deepClone(res.data.data)
      produceList.forEach(item => {
@@ -173,13 +174,17 @@
  if (optionVal == '') {
    optionVal = null
  }
  request.post(`/report/workInProgress/${pageNum.value}/${total.pageSize}/${inputVal}/${inputProject}/${selectProcesses}/${optionVal}`, filterData.value).then((res) => {
  let terminationVals = terminationVal.value
  if (terminationVals == '') {
    terminationVals = null
  }
  request.post(`/report/workInProgress/${pageNum.value}/${total.pageSize}/${inputVal}/${inputProject}/${selectProcesses}/${optionVal}/${terminationVals}`, filterData.value).then((res) => {
    if (res.code == 200) {
      total.dataTotal = res.data.total.total * 1
      total.pageTotal = res.data.total.pageTotal
      pageTotal.value = res.data.total
      total.value = res.data.total
      total.value = res.data.total;
      total.dataTotal = res.data.total.total * 1;
      total.pageTotal = res.data.total.pageTotal;
      pageTotal.value = res.data.total;
      res.data.data.forEach(item => {
        // 如果 shape 可能是字符串就用 ==,如果一定是数字就用 ===
        item.shape = (item.shape == 2) ? t('order.alien') : t('order.universalShape');
@@ -235,13 +240,17 @@
  if (optionVal == '') {
    optionVal = null
  }
  request.post(`/report/workInProgress/${pageNum.value}/${total.pageSize}/${inputVal}/${inputProject}/${selectProcesses}/${optionVal}`, filterData.value).then((res) => {
  let terminationVals = terminationVal.value
  if (terminationVals == '') {
    terminationVals = null
  }
  request.post(`/report/workInProgress/${pageNum.value}/${total.pageSize}/${inputVal}/${inputProject}/${selectProcesses}/${optionVal}/${terminationVals}`, filterData.value).then((res) => {
    if (res.code == 200) {
      total.dataTotal = res.data.total.total * 1
      total.pageTotal = res.data.total.pageTotal
      pageTotal.value = res.data.total
      total.value = res.data.total
      total.value = res.data.total;
      total.dataTotal = res.data.total.total * 1;
      total.pageTotal = res.data.total.pageTotal;
      pageTotal.value = res.data.total;
      produceList = deepClone(res.data.data)
      produceList.forEach(item => {
        // 如果 shape 可能是字符串就用 ==,如果一定是数字就用 ===
@@ -351,6 +360,7 @@
      slots: {filter: 'num1_filter'},},
    {field: 'childHeight', width: 120, title: t('order.height'),visible: true,filters: [{data: ''}],
      slots: {filter: 'num1_filter'},},
    {field: 'thickness',width: 90, title: t('order.totalThickness'),visible: true},
    {field: 'stockNum', width: 120, title: t('productStock.inventoryQuantity'),visible: true,filters: [{data: ''}],
      slots: {filter: 'num1_filter'},},
    {field: 'stockArea', width: 120, title: t('report.inventoryArea'),visible: true,filters: [{data: ''}],
@@ -386,7 +396,7 @@
        const List = ["quantity",'stockNum','stockArea',]
        if (List.includes(column.field)) {
          //return footSum(data, column.field)
          return footSum(data, column.field)
          return total.value?.[column.field] ?? 0
        }
        return ''
      })
@@ -405,6 +415,10 @@
  if (inputProject == '') {
    inputProject = null
  }
  let terminationVals = terminationVal.value
  if (terminationVals == '') {
    terminationVals = null
  }
  if(date===null){
    ElMessage.warning(t('report.pleaseSelectADateFirst'))
    return
@@ -414,7 +428,7 @@
    ElMessage.warning(t('report.pleaseSelectAProcessFirst'))
    return
  }
  gridOptions.loading = true
  const date1 = new Date(date[0]);
  const date2 = new Date(date[1]);
  const timeDiff = Math.abs(date2.getTime() - date1.getTime());
@@ -427,7 +441,8 @@
    date: date,
    processes: processes,
    orderId: inputVal,
    project: inputProject
    project: inputProject,
    terminationVals:terminationVals
  })
  request.post(url,dataMp.value,{responseType :'blob'}).then(res => {
    const blob = new Blob([res])
@@ -440,6 +455,7 @@
      elink.click()
      URL.revokeObjectURL(elink.href) // 释放URL 对象
      document.body.removeChild(elink)
      gridOptions.loading = false
    } else { // IE10+下载
      navigator.msSaveBlob(blob, fileName)
    }
@@ -472,6 +488,9 @@
const handleCellDblClick = ({ row, column, cell, $event }) => {
  VxeUI.clipboard.copy(row[column.property])
}
function onlandingTerminationChange(checked) {
  terminationVal.value = checked ? 0 : 1
}
</script>
<template>
@@ -493,12 +512,23 @@
       {{$t('report.workingProcedure')}}:
        <el-select v-model="valueProcess" clearable :placeholder="$t('reportingWorks.selectProcess')" default-value="default_city" style="width: 120px">
          <el-option
              :label="t('report.allProcess')"
              :value="'all'"
          />
          <el-option
              v-for="item in titleSelectJson['processType']"
              :key="item.id"
              :label="item.basic_name"
              :value="item.basic_name"
          />
        </el-select>
      &nbsp;
      <el-checkbox
          :model-value="terminationVal === 0"
          @change="onlandingTerminationChange"
      >
        {{ t('processCard.termination') }}
      </el-checkbox>
        &nbsp;
        <el-button type="primary" @click="getWorkOrder">{{$t('basicData.search')}}</el-button>
    </div>