| | |
| | | <script setup> |
| | | |
| | | import {reactive, ref} from "vue"; |
| | | import {onMounted, reactive, ref} from "vue"; |
| | | import {useRouter} from 'vue-router' |
| | | import request from "@/utils/request"; |
| | | import deepClone from "@/utils/deepClone"; |
| | |
| | | import {useI18n} from 'vue-i18n' |
| | | import { filterChanged} from "@/hook" |
| | | import footSum from "@/hook/footSum" |
| | | import {addListener} from "@/hook/mouseMove"; |
| | | import {VxeUI} from "vxe-pc-ui"; |
| | | //语言获取 |
| | | const {t} = useI18n() |
| | | let router = useRouter() |
| | |
| | | |
| | | //项目名称汇总 |
| | | let projectSummary= ref(1) |
| | | //终止状态 |
| | | let terminationVal = ref(1) |
| | | //工序 |
| | | const value = ref() |
| | | |
| | |
| | | let pageNum = ref(1) |
| | | let pageState = null |
| | | |
| | | |
| | | onMounted(() => { |
| | | //启用表格拖动选中 |
| | | addListener(xGrid.value, gridOptions) |
| | | }) |
| | | |
| | | //第一次加载 |
| | | let selectProcesses = value.value |
| | |
| | | dataTotal: 0, |
| | | pageSize: 100 |
| | | }) |
| | | let newItem= ref({ |
| | | basic_name: '全部', |
| | | basic_type: 'product', |
| | | basic_category: 'process', |
| | | id: "001" |
| | | }) |
| | | |
| | | //定义接收加载表头下拉数据 |
| | | const titleSelectJson = ref({ |
| | | processType: [], |
| | |
| | | if (optionVal == '') { |
| | | optionVal = null |
| | | } |
| | | let terminationVals = terminationVal.value |
| | | if (terminationVals == '') { |
| | | terminationVals = null |
| | | } |
| | | //第一次加载数据 |
| | | request.post(`/report/workInProgressCombination/1/${total.pageSize}/${selectProcesses}/${inputVal}/${inputProject}/${optionVal}`, filterData.value).then((res) => { |
| | | request.post(`/report/workInProgressCombinationProcess/1/${total.pageSize}/${selectProcesses}/${inputVal}/${inputProject}/${optionVal}`, filterData.value).then((res) => { |
| | | |
| | | if (res.code == 200) { |
| | | console.log(res.data) |
| | | // total.dataTotal = res.data.total.total*1 |
| | | // total.pageTotal= res.data.total.pageTotal |
| | | // pageTotal.value = res.data.total |
| | |
| | | // 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) |
| | | //xGrid.value.reloadData(produceList) |
| | | gridOptions.loading = false |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | |
| | | if (optionVal == '') { |
| | | optionVal = null |
| | | } |
| | | request.post(`/report/workInProgressCombination/${pageNum.value}/${total.pageSize}/${inputVal}/${inputProject}/${selectProcesses}/${optionVal}`, filterData.value).then((res) => { |
| | | let terminationVals = terminationVal.value |
| | | if (terminationVals == '') { |
| | | terminationVals = null |
| | | } |
| | | request.post(`/report/workInProgressCombination/${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) |
| | |
| | | if (optionVal == '') { |
| | | optionVal = null |
| | | } |
| | | request.post(`/report/workInProgressCombination/${pageNum.value}/${total.pageSize}/${inputVal}/${inputProject}/${selectProcesses}/${optionVal}`, filterData.value).then((res) => { |
| | | let terminationVals = terminationVal.value |
| | | if (terminationVals == '') { |
| | | terminationVals = null |
| | | } |
| | | request.post(`/report/workInProgressCombination/${pageNum.value}/${total.pageSize}/${inputVal}/${inputProject}/${selectProcesses}/${optionVal}/${terminationVals}`, filterData.value).then((res) => { |
| | | |
| | | if (res.code == 200) { |
| | | console.log(res.data.data) |
| | | // total.dataTotal = res.data.total.total * 1 |
| | | // total.pageTotal = res.data.total.pageTotal |
| | | // pageTotal.value = res.data.total |
| | |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | //handleUpdateData(produceList) |
| | | }) |
| | | } |
| | | |
| | |
| | | $panel.changeOption(event, !!option.data, option) |
| | | } |
| | | |
| | | // function filterChanged(column){ |
| | | // gridOptions.loading = true |
| | | // //筛选条件发生变化条件发生变化 |
| | | // let value = column.datas[0] != undefined ? column.datas[0] : '' |
| | | // value = value.trim() |
| | | // //判断是否存在外键 |
| | | // if (column.property.indexOf('.') > -1) { |
| | | // const columnArr = column.property.split('.') |
| | | // filterData.value[columnArr[0]] = { |
| | | // [columnArr[1]]: value |
| | | // } |
| | | // } else { |
| | | // filterData.value[column.property] = value |
| | | // } |
| | | // |
| | | // getWorkOrder() |
| | | // |
| | | // |
| | | // } |
| | | |
| | | |
| | | /*后端返回结果多层嵌套展示*/ |
| | | const hasDecimal = (value) => { |
| | |
| | | filterMethod: filterChanged, |
| | | }, |
| | | { |
| | | field: 'project', width: 120, title: t('order.project'), filters: [{data: ''}], |
| | | field: 'project', width: 220, title: t('order.project'), filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | filterMethod: filterChanged, |
| | | visible: true |
| | |
| | | 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 '' |
| | | }) |
| | |
| | | |
| | | }) |
| | | |
| | | const handleUpdateData = (data) =>{ |
| | | |
| | | // const usedColumns = new Set(); |
| | | // data.forEach(row => { |
| | | // Object.keys(row).forEach(key => { |
| | | // usedColumns.add(key); |
| | | // }); |
| | | // }); |
| | | // // 更新 columns 数组的 visible 属性来控制列的显示 |
| | | // gridOptions.columns.forEach(column => { |
| | | // |
| | | // column.visible = usedColumns.has(column.field); |
| | | // }); |
| | | |
| | | //const columns = gridOptions.columns; |
| | | // const ageColumn = columns.find(col => col.property === 'age'); |
| | | // if (ageColumn) { |
| | | // ageColumn.visible = !ageColumn.visible; |
| | | // VXETable.updateColumns(tableRef.value, columns); |
| | | // } |
| | | } |
| | | function onlandingSequenceChange(checked) { |
| | | projectSummary.value = checked ? 0 : 1 |
| | | } |
| | | |
| | | function onlandingTerminationChange(checked) { |
| | | terminationVal.value = checked ? 0 : 1 |
| | | } |
| | | |
| | | function exportExcel(url, fileName,date) { |
| | | |
| | | let processes = value.value |
| | | let inputVal = form.orderId |
| | | if (inputVal == '') { |
| | |
| | | if (inputProject == '') { |
| | | inputProject = null |
| | | } |
| | | let terminationVals = terminationVal.value |
| | | if (terminationVals == '') { |
| | | terminationVals = null |
| | | } |
| | | if(date===null){ |
| | | ElMessage.warning(t('report.pleaseSelectADateFirst')) |
| | | return |
| | | } |
| | | |
| | | gridOptions.loading = true |
| | | if(processes===null){ |
| | | ElMessage.warning(t('report.pleaseSelectAProcessFirst')) |
| | | return |
| | |
| | | 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]) |
| | |
| | | elink.click() |
| | | URL.revokeObjectURL(elink.href) // 释放URL 对象 |
| | | document.body.removeChild(elink) |
| | | gridOptions.loading = false |
| | | } else { // IE10+下载 |
| | | navigator.msSaveBlob(blob, fileName) |
| | | } |
| | | |
| | | }) |
| | | } |
| | | |
| | | const handleCellDblClick = ({ row, column, cell, $event }) => { |
| | | VxeUI.clipboard.copy(row[column.property]) |
| | | } |
| | | </script> |
| | | |
| | |
| | | <el-input v-model="form.project" clearable :placeholder="$t('order.project')" style="width: 130px;display: none"></el-input> |
| | | {{$t('report.workingProcedure')}}: |
| | | <el-select v-model="value" 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" |
| | |
| | | > |
| | | {{ t('order.project') }} |
| | | </el-checkbox> |
| | | <el-checkbox |
| | | :model-value="terminationVal === 0" |
| | | @change="onlandingTerminationChange" |
| | | > |
| | | {{ t('processCard.notTermination') }} |
| | | </el-checkbox> |
| | | |
| | | <el-button type="primary" @click="getWorkOrder">{{$t('basicData.search')}}</el-button> |
| | | </div> |
| | |
| | | height="100%" |
| | | v-bind="gridOptions" |
| | | :optimize="true" |
| | | |
| | | @cell-dblclick="handleCellDblClick" |
| | | > |
| | | <!-- @toolbar-button-click="toolbarButtonClickEvent"--> |
| | | <!-- 下拉显示所有信息插槽--> |
| | |
| | | width: 100%; |
| | | height: calc(100% - 35px); |
| | | } |
| | | .vxe-grid { |
| | | /* 禁用浏览器默认选中 */ |
| | | -webkit-user-select: none; |
| | | -moz-user-select: none; |
| | | -ms-user-select: none; |
| | | user-select: none; |
| | | } |
| | | </style> |