chore: save local MES snapshot

This commit is contained in:
2026-06-25 15:49:15 +08:00
parent 4f6a16fb2e
commit f6dce5daa8
102 changed files with 45101 additions and 218 deletions

View File

@@ -0,0 +1,267 @@
<template>
<div class="assembly-punctual-inspection">
<el-card>
<div class="search-container">
<span class="show-text">生产订单:</span>
<el-input
v-model="productionOrder"
placeholder="请输入生产订单"
clearable
style="width: 150px; margin-right: 10px"
@keyup.enter.native="searchTable"
/>
<span class="show-text">销售订单:</span>
<el-input
v-model="salesOrder"
placeholder="请输入销售订单"
clearable
style="width: 150px; margin-right: 10px"
@keyup.enter.native="searchTable"
/>
<span class="show-text">物料编码:</span>
<el-input
v-model="materialCode"
placeholder="请输入物料编码"
clearable
style="width: 180px; margin-right: 10px"
@keyup.enter.native="searchTable"
/>
<span class="show-text">物料名称:</span>
<el-input
v-model="materialName"
placeholder="请输入物料名称"
clearable
style="width: 180px; margin-right: 10px"
@keyup.enter.native="searchTable"
/>
<span class="show-text">工序名称:</span>
<el-input
v-model="processName"
placeholder="请输入工序名称"
clearable
style="width: 150px; margin-right: 10px"
@keyup.enter.native="searchTable"
/>
<el-button :disabled="loading" icon="el-icon-search" plain type="primary" @click="searchTable">查询</el-button>
<el-button :disabled="loading || tableData.length === 0" icon="el-icon-download" plain type="success" @click="exportToExcel">导出</el-button>
</div>
<div class="table-tip">
仅显示预计送检日期小于等于今天的数据
</div>
<el-table
v-loading="loading"
:data="tableData"
:height="'70vh'"
:row-class-name="tableRowClassName"
border
element-loading-background="rgba(0, 0, 0, 0.2)"
element-loading-spinner="el-icon-loading"
highlight-current-row
size="mini"
style="width: 100%; margin-top: 16px"
tooltip-effect="dark"
>
<el-table-column align="center" label="序号" type="index" width="60" fixed />
<el-table-column align="center" prop="任务类型" label="任务类型" width="90" fixed />
<el-table-column align="center" prop="预计送检日期" label="预计送检日期" width="120" fixed show-overflow-tooltip>
<template slot-scope="scope">
{{ formatDate(scope.row.预计送检日期) }}
</template>
</el-table-column>
<el-table-column align="center" prop="订单号" label="生产订单" width="100" fixed />
<el-table-column align="center" prop="合同号" label="销售订单" width="120" fixed show-overflow-tooltip />
<el-table-column align="center" prop="产品编码" label="物料编码" width="180" show-overflow-tooltip />
<el-table-column align="center" prop="产品名称" label="物料名称" width="220" show-overflow-tooltip />
<el-table-column align="center" prop="工序名称" label="工序名称" width="120" show-overflow-tooltip />
<el-table-column align="center" prop="计划数量" label="计划数量" width="100" />
<el-table-column align="center" prop="指派对象" label="指派对象" width="140" show-overflow-tooltip />
<el-table-column align="center" prop="计划开始时间" label="计划开始时间" width="120">
<template slot-scope="scope">
{{ formatDate(scope.row.计划开始时间) }}
</template>
</el-table-column>
<el-table-column align="center" prop="计划完成时间" label="计划完成时间" width="120">
<template slot-scope="scope">
{{ formatDate(scope.row.计划完成时间) }}
</template>
</el-table-column>
<el-table-column align="center" prop="齐套时间" label="齐套时间" width="120">
<template slot-scope="scope">
{{ formatDate(scope.row.齐套时间) }}
</template>
</el-table-column>
<el-table-column align="center" prop="钣金预达时间" label="钣金预达时间" width="120">
<template slot-scope="scope">
{{ formatDate(scope.row.钣金预达时间) }}
</template>
</el-table-column>
<el-table-column align="center" prop="加急状态" label="加急状态" width="90" />
</el-table>
</el-card>
</div>
</template>
<script>
import * as XLSX from 'xlsx'
export default {
name: 'AssemblyPunctualInspection',
data() {
return {
productionOrder: '',
salesOrder: '',
materialCode: '',
materialName: '',
processName: '',
loading: false,
tableData: []
}
},
mounted() {
this.searchTable()
},
methods: {
formatDate(value) {
if (!value) return ''
return String(value).split(' ')[0]
},
tableRowClassName({ row }) {
if (this.isOverdue(row.预计送检日期)) {
return 'overdue-row'
}
if (this.isToday(row.预计送检日期)) {
return 'today-row'
}
return ''
},
async searchTable() {
this.loading = true
try {
const param = []
param.push(['订单号', this.productionOrder || 0])
param.push(['合同号', this.salesOrder])
param.push(['产品编码', this.materialCode])
param.push(['产品名称', this.materialName])
param.push(['工序名称', this.processName])
param.push(['辅助配件', '不含'])
const data = this.CreateData('11', '异常提醒_装配及时送检_查询', param)
const response = await this.ExecDatabase(data)
this.tableData = response.data || []
} catch (error) {
this.$message.error('查询失败: ' + error.message)
this.tableData = []
} finally {
this.loading = false
}
},
isOverdue(value) {
const targetTime = this.getDateTime(value)
if (targetTime === Infinity) {
return false
}
return targetTime < this.getTodayTime()
},
isToday(value) {
const targetTime = this.getDateTime(value)
if (targetTime === Infinity) {
return false
}
return targetTime === this.getTodayTime()
},
getTodayTime() {
const now = new Date()
now.setHours(0, 0, 0, 0)
return now.getTime()
},
getDateTime(value) {
if (!value) {
return Infinity
}
const dateText = this.formatDate(value).replace(/-/g, '/')
const date = new Date(dateText)
if (Number.isNaN(date.getTime())) {
return Infinity
}
date.setHours(0, 0, 0, 0)
return date.getTime()
},
exportToExcel() {
const exportData = this.tableData.map((item, index) => ({
序号: index + 1,
任务类型: item.任务类型,
预计送检日期: item.预计送检日期,
生产订单: item.订单号,
销售订单: item.合同号,
物料编码: item.产品编码,
物料名称: item.产品名称,
工序名称: item.工序名称,
计划数量: item.计划数量,
指派对象: item.指派对象,
计划开始时间: this.formatDate(item.计划开始时间),
计划完成时间: this.formatDate(item.计划完成时间),
齐套时间: this.formatDate(item.齐套时间),
钣金预达时间: this.formatDate(item.钣金预达时间),
加急状态: item.加急状态
}))
const wb = XLSX.utils.book_new()
const ws = XLSX.utils.json_to_sheet(exportData)
ws['!cols'] = [
{ wch: 8 },
{ wch: 10 },
{ wch: 14 },
{ wch: 14 },
{ wch: 14 },
{ wch: 22 },
{ wch: 28 },
{ wch: 14 },
{ wch: 10 },
{ wch: 14 },
{ wch: 14 },
{ wch: 14 },
{ wch: 14 },
{ wch: 14 },
{ wch: 10 }
]
XLSX.utils.book_append_sheet(wb, ws, '装配及时送检')
XLSX.writeFile(wb, '装配及时送检.xlsx')
this.$message.success('导出成功')
}
}
}
</script>
<style scoped>
.assembly-punctual-inspection {
padding: 10px;
}
.search-container {
display: flex;
align-items: center;
flex-wrap: wrap;
}
.show-text {
font-size: 14px;
margin-right: 6px;
}
.table-tip {
margin-top: 12px;
color: #909399;
font-size: 13px;
}
::v-deep .overdue-row > td {
background-color: #fde2e2 !important;
}
::v-deep .today-row > td {
background-color: #faecd8 !important;
}
</style>

View File

@@ -0,0 +1,489 @@
<template>
<div class="app-container">
<el-card style="height: 850px">
<div style="margin-top: 7px; margin-bottom: 7px">
<span class="show-text">生产订单:</span>
<el-input
v-model="orderNo"
placeholder="请输入生产订单"
clearable
style="width: 150px; margin-right: 10px"
@change="searchTable()"
/>
<span class="show-text">计划号:</span>
<el-input
v-model="plannum"
placeholder="请输入生产订单"
clearable
style="width: 150px; margin-right: 10px"
/>
<span class="show-text">物料编码:</span>
<el-input
v-model="productCode"
placeholder="请输入物料编码"
clearable
style="width: 150px; margin-right: 10px"
/>
<span class="show-text">物料名称:</span>
<el-input
v-model="itemName"
placeholder="请输入物料名称"
clearable
style="width: 150px; margin-right: 10px"
/>
<span class="show-text">工序名称:</span>
<el-input
v-model="processName"
placeholder="请输入工序名称"
clearable
style="width: 150px; margin-right: 10px"
/>
<span class="show-text">执行状态:</span>
<el-select v-model="dostate" placeholder="请选择">
<el-option
v-for="item in dostateoptions"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<el-button
icon="el-icon-search"
plain
type="primary"
@click="searchTable()"
>查询</el-button
>
</div>
<el-table
:data="mergedTableData"
highlight-current-row
border
size="small"
style="margin-top: 10px"
height="75vh"
@selection-change="handleSelectionChange"
@row-click="handleRowClick">
<el-table-column type="selection" width="50"></el-table-column>
<el-table-column label="序号" type="index" align="center" width="50"/>
<el-table-column label="生产订单" align="center" prop="订单号" width="80" />
<el-table-column label="计划号" align="center" prop="计划号" width="80" />
<el-table-column label="工序名称" align="center" prop="工序名称" width="120"/>
<el-table-column label="物料名称" align="center" prop="产品名称" width="200"/>
<el-table-column label="同步状态" align="center" width="100">
<template slot-scope="scope">
{{scope.row.派工状态 === 1 ? '已同步':'未同步'}}
</template>
</el-table-column>
<el-table-column label="上序合格数" align="center" prop="上序合格数" width="100"/>
<el-table-column label="指派数量" align="center" prop="指派数量" width="80"/>
<el-table-column label="打印数量" align="center" prop="打印数量" width="80"/>
<el-table-column label="发料数量" align="center" prop="收料数量" width="80"/>
<el-table-column label="收货数量" align="center" prop="完成数量" width="80"/>
<el-table-column label="备注" align="center" prop="外协备注" width="200"/>
<el-table-column label="单重" align="center" prop="单重" width="80"/>
<el-table-column label="物料编码" align="center" prop="产品编码" width="200"/>
<el-table-column label="打印次数" align="center" prop="外协打印次数" width="120"/>
<el-table-column label="计划开始时间" align="center" prop="计划开始时间" width="120">
<template slot-scope="scope">
{{formatDate(scope.row.计划开始时间)}}
</template>
</el-table-column>
<el-table-column label="计划完成时间" align="center" prop="计划完成时间" width="120">
<template slot-scope="scope">
{{formatDate(scope.row.计划完成时间)}}
</template>
</el-table-column>
</el-table>
</el-card>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import { postB1 } from '@/api/b1s';
import $ from 'jquery'
import QRCode from 'qrcode'
import { set } from 'nprogress';
import { MESDownFile } from '@/utils/request'
import { seepdf, initPDFKeyboardShortcuts, setZoom } from '@/utils/pdf';
export default {
data() {
return {
downPDF:MESDownFile,
seeVisible:false,
qrCodeDataUrl:'',
printDataList2:[],
historyVisible:false,
printdata2:[],
historydata:[],
dialogFormVisible1: false,
tableData: [], // 原始数据
mergedTableData: [], // 合并后的数据
selectedRow:'',
selectedRow2:'',
productCode:'',
orderNo:'',
plannum:'',
processName:'',
itemName:'',
sessionId:'',
currentTime:'',
receiveVisible:false,
receiveData: {},
receiveNum: 0,
doVisible:false,
doData: {},
doNum: 0,
// 新增:存储合并数据的原始信息
mergedDataMap: new Map(), // 用于存储合并数据对应的原始数据组
workstate:0,
orderstate:0,
dostate:1,
workstateoptions:[{
value: 0,
label: '未同步'
}, {
value: 1,
label: '已同步',
disabled: true
}],
stateoptions:[{
value: 0,
label: '未完成',
disabled: true
}, {
value: 1,
label: '已完成',
}],
dostateoptions:[{
value: 0,
label: '全部',
disabled: true
}, {
value: 1,
label: '可执行',
},{
value: 2,
label: '不可执行',
}],
multipleSelection: [],
printDataList: [] ,// 新增:存储多个打印数据
numname:'',
textweight:'',
textsum:'',
textcontent:'',
textData:{},
textVisible:false,
qrCodeCache: new Map(),
qrCodeUrl: '',
}
},
computed: {
...mapGetters([
'id',
'token'
]),
},
created() {
this.searchTable()
setInterval(this.getCurrentTime, 1000);
},
methods: {
handleSelectionChange(val) {
this.multipleSelection = val;
},
getCurrentTime() {
const now = new Date();
const year = now.getFullYear();
const month = String(now.getMonth() + 1).padStart(2, "0");
const day = String(now.getDate()).padStart(2, "0");
const hours = String(now.getHours()).padStart(2, "0");
const minutes = String(now.getMinutes()).padStart(2, "0");
const seconds = String(now.getSeconds()).padStart(2, "0");
this.currentTime = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
},
handleRowClick(row) {
this.selectedRow = row
},
handleRowClick2(row) {
this.selectedRow2 = row
},
searchTable() {
this.loading = true
var param = []
param.push(["订单号",this.orderNo])
param.push(["产品编码",this.productCode])
param.push(["产品名称",this.itemName])
param.push(["工序名称",this.processName])
param.push(["计划号",this.plannum])
var Data = this.CreateData('11', '异常提醒_外协及时开工_查询',param)
this.ExecDatabase(Data).then(response => {
this.tableData = response.data
this.mergeTableData() // 处理数据合并
})
},
// 合并表格数据的方法
mergeTableData() {
if (!this.tableData || this.tableData.length === 0) {
this.mergedTableData = [];
this.mergedDataMap.clear();
return;
}
const groupedByOrder = {};
this.tableData.forEach(item => {
const groupKey = `${item.订单号}_${item.拆分内码}`;
if (!groupedByOrder[groupKey]) {
groupedByOrder[groupKey] = [];
}
groupedByOrder[groupKey].push(item);
});
const mergedData = [];
this.mergedDataMap.clear();
Object.keys(groupedByOrder).forEach(orderNo => {
const orderItems = groupedByOrder[orderNo];
orderItems.sort((a, b) => a.订单行号 - b.订单行号);
let currentGroup = [orderItems[0]];
for (let i = 1; i < orderItems.length; i++) {
const currentItem = orderItems[i];
const lastItem = orderItems[i - 1];
if (currentItem.订单行号 === lastItem.订单行号 + 1 && currentItem.外协分组 === lastItem.外协分组 && currentItem.拆分内码 === lastItem.拆分内码) {
currentGroup.push(currentItem);
} else {
// 检查组内最小计划开始时间是否小于今天
if (this.checkGroupPlanStartValid(currentGroup)) {
if (this.checkGroupAllZero(currentGroup)) {
const mergedItem = this.mergeGroup(currentGroup);
if (this.shouldIncludeByExecutionStatus(mergedItem)) {
mergedData.push(mergedItem);
this.mergedDataMap.set(mergedItem.uniqueKey, currentGroup);
}
}
}
currentGroup = [currentItem];
}
}
// 处理最后一组
if (currentGroup.length > 0) {
if (this.checkGroupPlanStartValid(currentGroup)) {
if (this.checkGroupAllZero(currentGroup)) {
const mergedItem = this.mergeGroup(currentGroup);
if (this.shouldIncludeByExecutionStatus(mergedItem)) {
mergedData.push(mergedItem);
this.mergedDataMap.set(mergedItem.uniqueKey, currentGroup);
}
}
}
}
});
this.mergedTableData = mergedData;
},
// 新增:检查组内最小计划开始时间是否小于今天
checkGroupPlanStartValid(group) {
const today = new Date();
today.setHours(0, 0, 0, 0);
// 获取组内最小的计划开始时间
const minPlanStart = group.reduce((min, item) => {
if (!item.计划开始时间) return min;
const planDate = new Date(item.计划开始时间);
planDate.setHours(0, 0, 0, 0);
return planDate < min ? planDate : min;
}, new Date('2099-12-31'));
return minPlanStart < today;
},
// 新增检查组内所有数据的收料数量是否都为0
checkGroupAllZero(group) {
// 只有组内所有数据的收料数量都等于0才返回true
return group.every(item => {
const 收料数量 = Number(item.收料数量) || 0;
return 收料数量 === 0;
});
},
// 新增:根据执行状态筛选数据(纯前端筛选)
shouldIncludeByExecutionStatus(mergedItem) {
const 执行状态 = this.dostate; // 0=全部, 1=可执行, 2=不可执行
if (执行状态 === 0) {
return true; // 全部,不筛选
}
const itemExecutionStatus = mergedItem.执行状态 || 1; // 默认可执行
if (执行状态 === 1) {
return itemExecutionStatus === 1; // 只显示可执行
} else if (执行状态 === 2) {
return itemExecutionStatus === 2; // 只显示不可执行
}
return true;
},
// 合并单个组的数据
mergeGroup(group) {
if (group.length === 1) {
const item = group[0];
item.uniqueKey = `${item.订单号}_${item.订单行号}_${item.TaskAID}`;
// 确保TaskAID是字符串类型
item.TaskAID = String(item.TaskAID);
// 计算单条记录的执行状态
const 上序合格数 = item.上序合格数 || 0;
const 订单行号 = item.订单行号;
item.执行状态 = (订单行号 === 1 || 上序合格数 > 0) ? 1 : 2;
return item;
}
const mergedItem = { ...group[0] };
// 生成唯一标识key
mergedItem.uniqueKey = group.map(item => `${item.订单号}_${item.订单行号}_${item.TaskAID}`).join('|');
// 拼接工序名称(逗号间隔)
const processNames = group.map(item => item.工序名称);
mergedItem.工序名称 = processNames.join(',');
// 拼接TaskAID逗号间隔
const taskAIDs = [...new Set(group.map(item => String(item.TaskAID)))];
mergedItem.TaskAID = taskAIDs.join(',');
// 取计划开始时间的最小值
const startTimes = group.map(item => new Date(item.计划开始时间));
mergedItem.计划开始时间 = new Date(Math.min(...startTimes)).toISOString().slice(0, 19).replace('T', ' ');
// 取计划完成时间的最大值
const endTimes = group.map(item => new Date(item.计划完成时间));
mergedItem.计划完成时间 = new Date(Math.max(...endTimes)).toISOString().slice(0, 19).replace('T', ' ');
// 取最大值
const wcnum = group.map(item => item.完成数量);
mergedItem.完成数量 = Math.max(...wcnum);
const printnum = group.map(item => item.外协打印次数);
mergedItem.外协打印次数 = Math.max(...printnum);
const slnum = group.map(item => item.收料数量);
mergedItem.收料数量 = Math.max(...slnum);
// 计算上序合格数(取组内最大值)
const shxnum = group.map(item => item.上序合格数 || 0);
mergedItem.上序合格数 = Math.max(...shxnum);
// 计算执行状态:只要一组内包含订单行号=1 或者包含上序合格数>0都属于可执行
const hasFirstProcess = group.some(item => item.订单行号 === 1);
const hasPreviousQualified = group.some(item => (item.上序合格数 || 0) > 0);
mergedItem.执行状态 = (hasFirstProcess || hasPreviousQualified) ? 1 : 2;
// 存储原始组数据引用
mergedItem.originalGroup = group;
return mergedItem;
},
// 获取订单行号最大的TaskAID
getMaxOrderLineTaskAID(row) {
// 如果是单条数据直接返回TaskAID
if (typeof row.TaskAID === 'number' || !row.TaskAID.includes(',')) {
return String(row.TaskAID);
}
// 如果是合并数据从原始数据组中找订单行号最大的TaskAID
if (row.originalGroup) {
const maxOrderLineItem = row.originalGroup.reduce((max, item) => {
return item.订单行号 > max.订单行号 ? item : max;
}, row.originalGroup[0]);
return String(maxOrderLineItem.TaskAID);
}
// 如果没有原始组数据从TaskAID字符串中取最后一个
const taskAIDs = row.TaskAID.split(',');
return taskAIDs[taskAIDs.length - 1];
},
// 获取订单行号最小的TaskAID
getMinOrderLineTaskAID(row) {
// 如果是单条数据直接返回TaskAID
if (typeof row.TaskAID === 'number' || !row.TaskAID.includes(',')) {
return String(row.TaskAID);
}
// 如果是合并数据从原始数据组中找订单行号最大的TaskAID
console.log(row)
if (row.originalGroup) {
const minOrderLineItem = row.originalGroup.reduce((min, item) => {
return item.订单行号 < min.订单行号 ? item : min;
}, row.originalGroup[0]);
return String(minOrderLineItem.TaskAID);
}
// 如果没有原始组数据从TaskAID字符串中取最后一个
const taskAIDs = row.TaskAID.split(',');
return taskAIDs[taskAIDs.length - 1];
},
formatDate(date) {
if (!date) return ''
return date.split(' ').length > 1 ? date.split(' ')[0] : date
},
}
}
</script>
<style>
.field-container {
border: 1px solid #000;
border-bottom:0px
}
.field-row {
display: flex;
width: 100%;
border-bottom: 1px solid #000;
}
.field-group {
display: flex;
width: 25%;
align-items: stretch;
border-right: 1px solid #000;
}
.field-group:last-child {
border-right: none;
}
.field-label {
width: 40%;
color: #000;
text-align: right;
padding: 12px 5px;
border-right: 1px solid #000;
display: flex;
align-items: center;
justify-content: flex-end;
}
.field-value {
width: 60%;
color: #303133;
word-break: break-word;
overflow-wrap: break-word;
padding: 12px 10px;
display: flex;
align-items: center;
}
</style>

View File

@@ -64,6 +64,14 @@
<el-option label="已开工" value="2" />
<el-option label="已完成" value="4" />
</el-select>
<el-switch
v-model="stationFilterMode"
active-text="工位正选"
inactive-text="工位反选"
active-value="include"
inactive-value="exclude"
style="margin-left: 20px;"
/>
<el-button
:disabled="loading"
icon="el-icon-search"
@@ -76,6 +84,7 @@
<el-checkbox v-for="item in Doingoptions" :key="item.工位号" :label="item.指南工位号" :value="item.工位号"> </el-checkbox>
</el-checkbox-group>
</div>
<el-table
v-loading="loading"
@@ -320,6 +329,7 @@ export default {
],
Doing: [],
Doingoptions: [],
stationFilterMode: 'include',
// DoingData: {
// 订单编号: "",
// 合同号: "",
@@ -549,6 +559,7 @@ export default {
param.push(["生产状态", this.productionStatus2]||-1);
param.push(["工位名称", this.Doing]);
param.push(["工位筛选模式", this.stationFilterMode]);
param.push(["用户ID" , this.$store.state.user.id])
param.push(["计划号" , this.plannum])
param.push(["销售订单" , this.salenum])

View File

@@ -0,0 +1,966 @@
<template>
<div>
<el-card>
<div class="search-container" @keyup.enter="searchTable">
<span class="show-text">生产订单:</span>
<el-input v-model="orderNo" placeholder="请输入生产订单" clearable style="width: 150px;margin-right: 10px" />
<span class="show-text">销售订单:</span>
<el-input v-model="contractNo" placeholder="请输入销售订单" clearable style="width: 150px;margin-right: 10px" />
<span class="show-text">产品编码:</span>
<el-input v-model="productCode" placeholder="请输入产品编码" clearable style="width: 150px;margin-right: 10px" />
<span class="show-text">计划号:</span>
<el-input v-model="plannum" placeholder="请输入计划号" clearable style="width: 150px;margin-right: 10px" />
<span class="show-text">自制件属性:</span>
<el-select v-model="selfStatus" clearable placeholder="请选择自制件属性" style="width: 150px;margin-right: 10px">
<el-option label="全部" value="全部" />
<el-option label="机加" value="机加" />
<el-option label="装配" value="装配" />
</el-select>
<!-- 新增外协过滤 -->
<span class="show-text">外协状态:</span>
<el-select v-model="outsourceStatus" clearable placeholder="请选择外协状态" style="width: 150px;margin-right: 10px">
<el-option label="全部" value="全部" />
<el-option label="是" value="是" />
<el-option label="否" value="否" />
</el-select>
<!-- 新增加急过滤 -->
<span class="show-text">加急状态:</span>
<el-select v-model="urgentStatus" clearable placeholder="请选择加急状态" style="width: 150px;margin-right: 10px">
<el-option label="全部" value="全部" />
<el-option label="加急" value="加急" />
<el-option label="正常" value="正常" />
</el-select>
<span class="show-text">单据状态:</span>
<el-select v-model="orderStatus" clearable placeholder="请选择单据状态" style="width: 150px;margin-right: 10px">
<el-option label="全部" value="全部" />
<el-option label="关闭" value="关闭" />
<el-option label="正常" value="正常" />
</el-select>
<!-- 其他搜索条件保持不变 -->
<el-button :disabled="loading" icon="el-icon-search" plain type="primary" @click="searchTable()">查询</el-button>
</div>
<el-table v-loading="loading" :data="tableData" :height="'80vh'" border
element-loading-background="rgba(0, 0, 0, 0.2)" element-loading-spinner="el-icon-loading" highlight-current-row
size="mini" style="width: 100%;margin-top: 20px;" tooltip-effect="dark" @row-click="handleRowClick">
<el-table-column type="expand">
<template slot-scope="scope">
<el-form label-position="left" class="demo-table-expand">
<el-table :data="scope.row.子数据" :row-class-name="getHeaderClass" border >
<el-table-column align="center" label="序号" type="index" width="50" />
<el-table-column align="center" label="工序名称" prop="工序名称" width="100" />
<el-table-column align="center" label="计划数量" prop="计划数量" width="100" />
<el-table-column align="center" label="指派对象" prop="指派对象" width="100" />
<!-- 在子数据中显示外协标识 -->
<!-- <el-table-column align="center" label="外协" width="80">
<template slot-scope="scope">
<div class="status-light" :class="scope.row.是否外协 ? 'status-light-green' : 'status-light-gray'" />
</template>
</el-table-column> -->
<el-table-column align="center" label="计划开始时间" prop="计划开始时间" width="100">
<template slot-scope="scope">{{ formatDate(scope.row.计划开始时间) }}</template>
</el-table-column>
<el-table-column align="center" label="计划结束时间" prop="计划完成时间" width="100">
<template slot-scope="scope">{{ formatDate(scope.row.计划完成时间) }}</template>
</el-table-column>
<el-table-column align="center" label="实际开始时间" prop="开始时间" width="100">
<template slot-scope="scope">{{ scope.row.开始时间 === '1900-01-01 00:00:00'? '':scope.row.开始时间}}</template>
</el-table-column>
<el-table-column align="center" label="实际结束时间" width="100">
<template slot-scope="scope">{{ scope.row.指派对象 === '外协' ? scope.row.外协结束时间 === '1900-01-01 00:00:00'? '':scope.row.外协结束时间 : scope.row.结束时间 === '1900-01-01 00:00:00'? '':scope.row.结束时间}}</template>
</el-table-column>
<el-table-column align="center" label="完成进度" prop="进度" width="100">
<template slot-scope="scope">{{ scope.row.进度}}%</template>
</el-table-column>
<el-table-column align="center" label="完成数量" prop="完成数量" width="100" />
<el-table-column align="center" label="外协发料数量" prop="收料数量" width="100" >
<template slot-scope="scope">{{scope.row.指派对象 === '外协' ? scope.row.收料数量:''}}</template>
</el-table-column>
<el-table-column align="center" label="合格数" prop="收检合格数" width="100" />
<el-table-column align="center" label="不良数" prop="收检不合格数" width="100" />
<el-table-column align="center" label="任务状态" prop="任务状态" width="100" />
<el-table-column align="center" label="加工状态" prop="加工状态" width="100" />
</el-table>
</el-form>
</template>
</el-table-column>
<!-- 主表列定义 -->
<el-table-column align="center" label="序号" type="index" width="50" />
<el-table-column align="center" prop="合同号" label="销售订单" width="120" />
<el-table-column align="center" prop="订单号" label="生产订单" width="100" />
<el-table-column align="center" prop="产品编码" label="产品编码" width="220" />
<el-table-column align="center" prop="产品名称" label="产品名称" width="190" />
<el-table-column align="center" prop="计划数量订单" label="计划数量" width="80" />
<el-table-column align="center" label="加急数量" width="80">
<template slot-scope="scope">
<div @click="Urgent(scope.row)" style="color: aqua;">
{{ scope.row.加急总数 }}
</div>
</template>
</el-table-column>
<el-table-column align="center" label="工艺路线" width="550">
<template slot-scope="scope">
<div class="process-route" v-html="formatProcessRoute(scope.row)" />
</template>
</el-table-column>
<el-table-column align="center" prop="入库数量" label="入库数量" width="80" />
<el-table-column align="center" label="要求完工日" width="120">
<template slot-scope="scope">{{ formatDate(scope.row.要求完工日期) }}</template>
</el-table-column>
<!-- 主表显示外协状态 -->
<!-- <el-table-column align="center" label="外协" width="80">
<template slot-scope="scope">
<div class="status-light" :class="scope.row.是否外协 ? 'status-light-green' : 'status-light-gray'" />
</template>
</el-table-column> -->
<!-- 其他状态列保持不变 -->
<el-table-column align="center" label="排产" width="80">
<template slot-scope="scope">
<div class="status-light" :class="scope.row.排产状态 === 1 ? 'status-light-green' : 'status-light-gray'" />
</template>
</el-table-column>
<el-table-column align="center" label="拣配" width="80">
<template slot-scope="scope">
<div class="status-light" :class="Number(scope.row.拣配状态) === 1 ? 'status-light-green' : 'status-light-gray'" />
</template>
</el-table-column>
<el-table-column align="center" label="开工" width="80">
<template slot-scope="scope">
<div class="status-light" :class="scope.row.开工时间 === 1 ? 'status-light-green' : 'status-light-gray'" />
</template>
</el-table-column>
<el-table-column align="center" label="终检" width="80">
<template slot-scope="scope">
<div class="status-light" :class="scope.row.终检 === '是' ? 'status-light-green' : 'status-light-gray'" />
</template>
</el-table-column>
<el-table-column align="center" label="加急" width="80">
<template slot-scope="scope">
<div class="status-light" :class="scope.row.加急状态 === '加急' ? 'status-light-green' : 'status-light-gray'" />
</template>
</el-table-column>
<el-table-column align="center" label="优先级" width="80">
<template slot-scope="scope">
<div class="status-light" :class="scope.row.优先级 === '是' ? 'status-light-green' : 'status-light-gray'" />
</template>
</el-table-column>
<el-table-column align="center" prop="当前序" label="当前序" width="80" />
<el-table-column align="center" prop="计划号" label="计划号" width="120" />
</el-table>
</el-card>
<el-dialog
:visible.sync="UrgentVisible"
title="加急明细"
width="1200px"
center
:close-on-click-modal="false"
>
<el-form ref="Urgentarr" :model="Urgentarr" size="mini">
<el-form-item v-for="item in Urgentarr" :key="item.订单编号" >
<div class="info-container" >
<div class="info-item">
<span class="info-label" style="width: 80px">生产订单</span>
<span class="info-value">
<el-input
v-model="item.订单编号"
size="mini"
readonly
style="width: 300px"
/>
</span>
</div>
<div class="info-item">
<span class="info-label" style="width: 80px">加急数量</span>
<span class="info-value">
<el-input
v-model="item.加急数量"
size="mini"
style="width: 150px"
readonly
/>
</span>
</div>
<div class="info-item">
<span class="info-label" style="width: 80px">物料编号</span>
<span class="info-value">
<el-input
v-model="item.物料编号"
size="mini"
style="width: 150px"
readonly
/>
</span>
</div>
</div>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="UrgentVisible = false">关闭</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
data() {
return {
orderNo: '',
contractNo: '',
productCode: '',
plannum: '',
productName: '',
processName: '',
nature: '',
productionStatus: '全部',
selfStatus: '全部',
// 新增过滤字段
outsourceStatus: '全部', // 外协状态
urgentStatus: '全部', // 加急状态
orderStatus:'正常',
completionTime: [],
loading: false,
tableData: [],
selectedRow: null,
editDialogVisible: false,
editSubmitLoading: false,
currentRow: {},
editForm: {
优先级: '',
未完成说明: '',
派工特殊说明: ''
},
splitTaskDialogVisible: false,
splitTaskSubmitLoading: false,
stationOptions: [],
splitTaskForm: {
分配数量: 0,
指派对象: '',
指派对象编号: '',
派工特殊备注: '',
计划开始时间: '',
计划结束时间: '',
最晚开始时间: '',
任务概述: ''
},
planStartTime: [],
planendTime: [],
UrgentVisible: false,
Urgentarr: {}
}
},
created() {
var now = new Date()
var start = new Date(Date.UTC(now.getFullYear() - 2, now.getMonth(), now.getDate(), 0, 0, 0)).toISOString().replace('T', ' ').replace('.000Z', '')
var end = new Date(Date.UTC(now.getFullYear(), now.getMonth(), now.getDate(), 23, 59, 59)).toISOString().replace('T', ' ').replace('.000Z', '')
this.searchTable()
},
methods: {
Urgent(row){
var param = []
param.push(["物料编号",row.产品编码])
this.UrgentVisible = true
var Data = this.CreateData("11", "加急订单_加急明细查询",param);
this.ExecDatabase(Data).then((response) => {
this.Urgentarr = response.data
});
},
getHeaderClass({ row, rowIndex }) {
if (row.绿 == 1) {
return 'warning-row'
} else if (row. === 1) {
return 'error-row'
} else if (row. === 1) {
return 'success-row'
} else {
return ''
}
},
formatDate(date) {
if (!date) return ''
return date.split(' ').length > 1 ? date.split(' ')[0] : date
},
formatProcessRouteDate(date) {
const formattedDate = this.formatDate(date)
const match = formattedDate.match(/^(\d{4})-(\d{2})-(\d{2})$/)
return match ? `${match[2]}-${match[3]}` : formattedDate
},
toProcessNumber(value) {
const num = Number(value)
return Number.isFinite(num) ? num : 0
},
escapeProcessHtml(value) {
return String(value == null ? '' : value)
.replace(/&/g, '&amp;')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
.replace(/"/g, '&quot;')
.replace(/'/g, '&#39;')
},
isOutsourceProcess(process) {
return process.指派对象 === '外协'
},
getProcessStatusNum(status) {
const statusNum = parseInt(status)
if (Number.isFinite(statusNum)) {
return statusNum
}
const statusMap = {
辅助开始: 2,
辅助结束: 3,
开始加工: 4,
暂停: 5,
报工: 6,
装配加工: 4
}
return statusMap[status] || 0
},
isBlueProcess(process) {
const statusNum = this.getProcessStatusNum(process.加工状态)
const countNum = parseInt(process.收检合格数)
return statusNum === 6 || statusNum === 3 || countNum > 0
},
isGreenProcess(process) {
console.log(process)
console.log( this.toProcessNumber(process.收料数量), this.toProcessNumber(process.完成数量),this.isOutsourceProcess(process))
return this.isOutsourceProcess(process) &&
this.toProcessNumber(process.收料数量) > this.toProcessNumber(process.完成数量) + this.toProcessNumber(process.收检不合格数)
},
getProcessBaseClass(process) {
if (this.isGreenProcess(process)) {
return 'process-route-green'
}
if (this.isBlueProcess(process)) {
return 'process-route-blue'
}
const statusNum = this.getProcessStatusNum(process.加工状态)
if (statusNum === 2 || statusNum === 4) {
return 'process-route-green'
}
return 'process-route-red'
},
getOutsourceGroupClassState(processes) {
const classes = new Map()
let currentIndexes = []
let lastProcess = null
const flushOutsourceRun = () => {
if (currentIndexes.length > 0 && lastProcess) {
const className = this.getProcessBaseClass(lastProcess)
currentIndexes.forEach(index => classes.set(index, className))
}
currentIndexes = []
lastProcess = null
}
const isSameContinuousGroup = process => {
if (!lastProcess) {
return true
}
const lineNo = this.toProcessNumber(process.订单行号)
const lastLineNo = this.toProcessNumber(lastProcess.订单行号)
return lineNo === lastLineNo + 1 &&
String(process.外协分组 || '') === String(lastProcess.外协分组 || '')
}
processes.forEach((process, index) => {
if (!this.isOutsourceProcess(process)) {
flushOutsourceRun()
return
}
if (!isSameContinuousGroup(process)) {
flushOutsourceRun()
}
currentIndexes.push(index)
lastProcess = process
})
flushOutsourceRun()
console.log(classes)
return classes
},
getProcessClass(process, index, outsourceGroupClasses) {
if (this.isOutsourceProcess(process)) {
return outsourceGroupClasses.get(index) || this.getProcessBaseClass(process)
}
return this.getProcessBaseClass(process)
},
getProcessRouteName(process) {
const name = String(process.工序名称 || '')
const assignee = String(process.指派对象 || '')
if (!assignee || name.includes(`(${assignee})`) || name.includes(`${assignee}`)) {
return name
}
return `${name}(${assignee})`
},
getRouteProcesses(row) {
if (Array.isArray(row.子数据) && row.子数据.length > 0) {
return row.子数据
}
return String(row.工艺路线 || '')
.split(',')
.map(name => name.trim())
.filter(Boolean)
.map(name => ({
工序名称: name,
加工状态: 0,
收检合格数: 0,
计划开始时间: '',
指派对象: '',
订单行号: 0,
收料数量: 0,
收检不合格数: 0
}))
},
formatProcessRoute(row) {
const processes = this.getRouteProcesses(row)
if (processes.length === 0) {
return ''
}
const outsourceGroupClasses = this.getOutsourceGroupClassState(processes)
const maxPerRow = 8
const rows = Math.ceil(processes.length / maxPerRow)
let tableHtml = '<div class="process-route-wrap"><table class="process-route-table"><tbody>'
for (let rowIndex = 0; rowIndex < rows; rowIndex++) {
const startIndex = rowIndex * maxPerRow
const endIndex = Math.min(startIndex + maxPerRow, processes.length)
const rowProcesses = processes.slice(startIndex, endIndex)
if (rowIndex > 0) {
tableHtml += '<tr class="process-route-spacer"><td colspan="' + (maxPerRow * 2 - 1) + '"></td></tr>'
}
tableHtml += '<tr>'
rowProcesses.forEach((process, index) => {
const className = this.getProcessClass(process, startIndex + index, outsourceGroupClasses)
const planDate = this.formatProcessRouteDate(process.计划开始时间 || process.计划完成时间 || '')
tableHtml += `<td class="process-route-date ${className}">${this.escapeProcessHtml(planDate)}</td>`
if (index < rowProcesses.length - 1) {
tableHtml += '<td class="process-route-arrow-hidden"></td>'
}
})
tableHtml += '</tr>'
tableHtml += '<tr>'
rowProcesses.forEach((process, index) => {
const className = this.getProcessClass(process, startIndex + index, outsourceGroupClasses)
const name = this.getProcessRouteName(process)
tableHtml += `<td class="${className}">${this.escapeProcessHtml(name)}</td>`
if (index < rowProcesses.length - 1) {
tableHtml += '<td class="process-route-arrow">→</td>'
}
})
tableHtml += '</tr>'
tableHtml += '<tr>'
rowProcesses.forEach((process, index) => {
const className = this.getProcessClass(process, startIndex + index, outsourceGroupClasses)
const count = this.toProcessNumber(process.收检合格数)
tableHtml += `<td class="process-route-count ${className}">合格${this.escapeProcessHtml(count)}</td>`
if (index < rowProcesses.length - 1) {
tableHtml += '<td class="process-route-arrow-hidden"></td>'
}
})
tableHtml += '</tr>'
}
tableHtml += '</tbody></table></div>'
return tableHtml
},
mergeOrderData(dataList) {
// 第一步:先按照订单行号对原始数据进行排序
const sortedDataList = [...dataList].sort((a, b) => {
const rowA = parseInt(a.订单行号 || 0)
const rowB = parseInt(b.订单行号 || 0)
return rowA - rowB
})
const orderMap = new Map()
sortedDataList.forEach((item, index) => {
const orderNumber = item.订单号
if (!orderMap.has(orderNumber)) {
// 判断该工序是否外协
const isOutsource = item.指派对象 && item.指派对象.includes('外协')
orderMap.set(orderNumber, {
...item,
当前序: '',
开工时间: 0,
序检: item.序检,
是否外协: isOutsource, // 新增:记录订单是否包含外协
子数据: [{
工序名称: item.工序名称,
指派对象: item.指派对象,
计划完成时间: item.计划完成时间,
计划开始时间: item.计划开始时间,
进度: item.进度,
拆分内码: item.拆分内码,
计划数量: item.计划数量,
开工时间: item.开工时间,
完成数量: item.完成数量,
收料数量: item.收料数量,
收检合格数: item.收检合格数,
收检不合格数: item.收检不合格数,
任务状态: item.任务状态,
加工状态: item.加工状态,
终检: item.终检,
是否外协: isOutsource, // 新增:记录该工序是否外协
绿: 0,
: 0,
: 0,
订单行号: item.订单行号,
加急总数:item.加急总数,
外协结束时间:item.外协结束时间,
开始时间:item.开始时间,
外协分组: item.外协分组
}]
})
} else {
const existingItem = orderMap.get(orderNumber)
// 判断该工序是否外协
const isOutsource = item.指派对象 && item.指派对象.includes('外协')
// 如果发现外协工序,更新订单的外协状态
if (isOutsource) {
existingItem.是否外协 = true
}
// 插入子数据时保持排序
existingItem.子数据.push({
工序名称: item.工序名称,
指派对象: item.指派对象,
计划完成时间: item.计划完成时间,
计划开始时间: item.计划开始时间,
进度: item.进度,
拆分内码: item.拆分内码,
计划数量: item.计划数量,
开工时间: item.开工时间,
完成数量: item.完成数量,
收料数量: item.收料数量,
收检合格数: item.收检合格数,
收检不合格数: item.收检不合格数,
任务状态: item.任务状态,
加工状态: item.加工状态,
终检: item.终检,
是否外协: isOutsource, // 新增:记录该工序是否外协
绿: 0,
: 0,
: 0,
订单行号: item.订单行号,
加急总数:item.加急总数,
开始时间:item.开始时间,
结束时间:item.结束时间,
外协结束时间:item.外协结束时间,
外协分组: item.外协分组
})
// 对子数据按照订单行号排序
existingItem.子数据.sort((a, b) => {
const rowA = parseInt(a.订单行号 || 0)
const rowB = parseInt(b.订单行号 || 0)
return rowA - rowB
})
existingItem.子数据.forEach((element, index) => {
if (new Date(element.开工时间) > new Date('1900-01-01 00:00:00')) {
element.绿 = 1
} else {
element.绿 = 0
}
if (element.进度 == 100) {
element. = 1
element.绿 = 0
} else {
element. = 0
}
if (index > 0) {
if (new Date(element.开工时间) == new Date('1900-01-01 00:00:00') && existingItem.子数据[index - 1].进度 == 100) {
element. = 1
element.绿 = 0
} else {
element. = 0
}
}
})
if (item.收检合格数 > 0) {
existingItem.当前序 = item.工序名称
}
if (item.优先级 == '是') {
existingItem.优先级 = item.优先级
}
if (item.终检 == '是') {
existingItem.终检 = item.终检
}
if (new Date(item.开工时间) > new Date('1900-01-01 00:00:00')) {
existingItem.开工时间 = 1
}
// 确保加急状态正确传递
if (item.加急状态 === '加急') {
existingItem.加急状态 = '加急'
}
}
})
// 应用过滤条件
let filteredData = Array.from(orderMap.values()).map(item => ({
订单号: item.订单号,
合同号: item.合同号,
产品编码: item.产品编码,
产品名称: item.产品名称,
计划数量订单: item.计划数量订单,
要求完工日期: item.要求完工日期,
排产状态: item.排产状态,
优先级: item.优先级,
当前序: item.当前序,
工艺路线: item.工艺路线,
计划数量: item.计划数量,
开工时间: item.开工时间,
序检: item.序检,
子数据: item.子数据,
加急状态: item.加急状态,
终检: item.终检,
计划号: item.计划号,
拣配状态: item.拣配状态,
是否外协: item.是否外协, // 新增:是否外协订单
加急数量: item.加急数量,
加急总数: item.加急总数,
入库数量: item.入库数量,
}))
// 应用外协过滤
if (this.outsourceStatus !== '全部') {
const isOutsource = this.outsourceStatus === '是'
filteredData = filteredData.filter(item => item.是否外协 === isOutsource)
}
// 应用加急过滤
if (this.urgentStatus !== '全部') {
const isUrgent = this.urgentStatus === '加急'
filteredData = filteredData.filter(item =>
isUrgent ? item.加急状态 === '加急' : (!item.加急状态 || item.加急状态 !== '加急')
)
}
this.tableData = filteredData
},
searchTable() {
this.loading = true
this.tableData = []
var param = []
param.push(['订单号', this.orderNo || 0])
param.push(['物料类型', '自制件'])
param.push(['合同号', this.contractNo])
param.push(['产品编码', this.productCode])
param.push(['产品名称', this.productName])
param.push(['工序名称', this.processName])
param.push(['计划开始1', this.planStartTime[0]])
param.push(['计划开始2', this.planStartTime[1]])
param.push(['计划完成1', this.planendTime[0]])
param.push(['计划完成2', this.planendTime[1]])
param.push(['要求完工日期1', this.completionTime ? this.completionTime[0] : ''])
param.push(['要求完工日期2', this.completionTime ? this.completionTime[1] : ''])
param.push(['排产状态', this.productionStatus])
param.push(['自制件属性', this.selfStatus])
param.push(['指派对象', '全部'])
param.push(['计划号', this.plannum])
param.push(['加急状态', this.urgentStatus])
param.push(['单据状态', this.orderStatus])
// // 添加外协状态过滤条件
// if (this.outsourceStatus !== '全部') {
// param.push(['是否外协', this.outsourceStatus === '是' ? 1 : 0])
// }
var Data = this.CreateData('11', '生产管理_生产计划跟踪', param)
this.ExecDatabase(Data).then(response => {
this.loading = false
if (response.data.length !== 0) {
this.mergeOrderData(response.data)
}
}).catch(() => {
this.loading = false
})
},
// 其他方法保持不变...
handleRowClick(row) {
this.selectedRow = row
},
editTask(row) {
this.currentRow = row
this.editForm = {
优先级: row.优先级 || '',
未完成说明: row.未完成说明 || '',
派工特殊说明: row.派工特殊说明 || ''
}
this.editDialogVisible = true
},
submitEditForm() {
this.editSubmitLoading = true
const params = []
params.push(['订单号', this.currentRow.订单号])
params.push(['订单行号', this.currentRow.订单行号])
params.push(['订单拆分内码', this.currentRow.拆分内码])
params.push(['优先级', this.editForm.优先级])
params.push(['未完成说明', this.editForm.未完成说明])
params.push(['派工特殊说明', this.editForm.派工特殊说明])
params.push(['最后编辑人', this.$store.state.user.name])
const Data = this.CreateData('12', 'MES_OrderPlanned_DescriptionEdit', params)
this.ExecDatabase(Data).then(() => {
this.$message.success('保存成功')
this.editDialogVisible = false
this.searchTable()
}).catch(() => {
this.$message.error('保存失败')
}).finally(() => {
this.editSubmitLoading = false
})
},
handleOutsourceNotify(row) {
this.$confirm('确认同计划发起外协通知吗?', '确认', {
confirmButtonText: '是',
cancelButtonText: '否',
type: 'warning',
center: true
}).then(() => {
this.$message.success('外协通知已发送')
}).catch(() => {
})
},
openSplitTask() {
if (!this.selectedRow) {
this.$message.warning('请先选择需要操作的行')
return
}
this.getStationList()
this.splitTaskForm = {
分配数量: this.selectedRow.计划数量 || 0,
指派对象: this.selectedRow.指派对象 || '',
指派对象编号: this.selectedRow.指派对象编号 || '',
派工特殊备注: this.selectedRow.派工特殊说明 || '',
计划开始时间: this.selectedRow.计划开始时间 || '',
计划结束时间: this.selectedRow.计划完成时间 || '',
最晚开始时间: this.selectedRow.最晚开始时间 || '',
任务概述: this.selectedRow.计划数量 || ''
}
this.splitTaskDialogVisible = true
},
submitSplitTaskForm() {
this.splitTaskSubmitLoading = true
this.$confirm('确认要拆分子任务吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
// 空逻辑
this.splitTaskSubmitLoading = false
this.splitTaskDialogVisible = false
this.$message.success('操作成功')
this.searchTable()
}).catch(() => {
this.splitTaskSubmitLoading = false
this.$message.info('已取消操作')
})
},
getStationList() {
const params = []
const Data = this.CreateData('11', 'Prog_MES_LoadStations', params)
this.ExecDatabase(Data).then(response => {
if (response.data && response.data.length > 0) {
this.stationOptions = response.data.map(item => ({
label: item.OPName,
value: item.OPName,
code: item.VisCode
}))
}
})
},
handleStationChange(value) {
const selected = this.stationOptions.find(item => item.value === value)
if (selected) {
this.splitTaskForm.指派对象编号 = selected.code
}
}
}
}
</script>
<style scoped>
::v-deep .el-table th.el-table__cell>.cell{
white-space: pre-wrap;
}
.process{
width: 120px;
display: inline-flex;
}
.process-route {
line-height: 1.4;
white-space: normal;
word-break: break-all;
}
::v-deep .process-route-wrap {
width: 100%;
text-align: left;
}
::v-deep .process-route-table {
width: auto;
border-collapse: collapse;
text-align: left;
table-layout: auto;
}
::v-deep .process-route-table td {
text-align: left;
padding: 2px 2px;
font-size: 11px;
white-space: nowrap;
line-height: 1.4;
}
::v-deep .process-route-date {
font-size: 10px !important;
color: #8899aa !important;
padding: 2px 2px !important;
}
::v-deep .process-route-count {
font-weight: 700;
font-size: 12px !important;
}
::v-deep .process-route-spacer td {
height: 4px;
padding: 0 !important;
line-height: 1 !important;
}
::v-deep .process-route-green {
color: #28d961;
font-weight: 700;
}
::v-deep .process-route-blue {
color: #09a8ff;
font-weight: 700;
}
::v-deep .process-route-red {
color: #ff3f37;
font-weight: 700;
}
::v-deep .process-route-arrow {
color: rgba(0, 164, 255, 0.6) !important;
font-size: 10px !important;
padding: 2px 0 !important;
width: 8px;
text-align: center !important;
}
::v-deep .process-route-arrow-hidden {
padding: 2px 0 !important;
width: 8px;
}
.search-container {
margin-bottom: 20px;
}
.show-text {
margin-right: 5px;
line-height: 32px;
}
.status-light {
display: inline-block;
width: 12px;
height: 12px;
border-radius: 50%;
}
.status-light-green {
background-color: #67C23A;
}
.status-light-gray {
background-color: #909399;
}
.dialog-footer {
text-align: right;
}
::v-deep .warning-row {
background-color: #67c23a !important;
}
::v-deep .error-row {
background-color: #409eff !important;
}
::v-deep .success-row {
background-color: #f2a201 !important;
}
::v-deep .el-table td.el-table__cell{
border: 0;
}
.info-container {
border: 1px solid #ccc;
display: flex;
}
.info-item {
display: flex;
flex: 1;
border-right: 1px solid #ccc;
}
.info-item:last-child {
border-right: none;
}
.info-label {
width: 30%;
padding: 8px;
background-color: #f5f7fa;
border-right: 1px solid #ccc;
}
.info-value {
flex: 1;
padding: 5px;
}
.info-label,
.info-value {
display: flex;
align-items: center;
}
.el-table tr{
background-color: initial;
}
</style>

View File

@@ -18,7 +18,7 @@
/>
&nbsp;&nbsp;
<span class="show-text">设备:</span>
<el-select v-model="equipmentType" placeholder="请选择设备" filterable size="small" style="width:200px" @change="searchTable" >
<el-select v-model="equipmentType" placeholder="请选择设备" filterable size="small" style="width:100px" @change="searchTable" >
<el-option
v-for="item in basedatalx"
:key="item.id"
@@ -43,7 +43,7 @@
</el-table-column>
<el-table-column label="参数值" align="center">
<template slot-scope="scope">
{{ scope.row.参数值 }}
{{ scope.row.参数值 }}{{ scope.row.参数单位 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="100px">
@@ -53,7 +53,7 @@
</el-table-column>
</el-table>
</div>
<div style="width: 600px;margin-left: 5px">
<div style="width: 800px;margin-left: 5px">
<el-table v-if="dataType === 1" :data="tableData1" v-loading="loading" border size="small" stripe highlight-current-row height="740px" >
<el-table-column label="开始时间" prop="Zone" align="center" width="150px" >
<template slot-scope="scope">
@@ -70,29 +70,130 @@
{{ scope.row.状态名称 }}
</template>
</el-table-column>
<el-table-column label="时长(m)" align="center">
<el-table-column label="时长(min)" align="center">
<template slot-scope="scope">
{{ scope.row.累计分钟数 }}
</template>
</el-table-column>
</el-table>
<el-table v-if="dataType === 2" :data="tableData1" border size="small" stripe highlight-current-row height="740px" >
<el-table-column label="订单编号" prop="Zone" align="center" width="150px" >
<div v-if="dataType === 2">
<span class="show-text">订单编号:</span>
<el-input
v-model="orderNo"
placeholder="请输入订单编号"
clearable
style="width: 150px; margin-right: 10px"
/>
<el-button type="primary" icon="el-icon-search" size="small" style="margin-left: 20px" plain @click="handleSearch(currentRow)">查询</el-button>
<el-table :data="tableData1" border size="small" stripe highlight-current-row height="700px" style="margin-top: 5px" >
<el-table-column label="订单编号" prop="Zone" align="center" width="100px" >
<template slot-scope="scope">
{{ scope.row.订单编号 }}
</template>
</el-table-column>
<el-table-column label="加工时长(min)" prop="TagName" align="center">
<template slot-scope="scope">
{{ scope.row.循环时间 }}
</template>
</el-table-column>
<el-table-column label="换件时长(min)" prop="TagName" align="center">
<template slot-scope="scope">
{{ scope.row.换件时间 }}
</template>
</el-table-column>
<el-table-column label="采集时间" align="center" width="150px" >
<template slot-scope="scope">
{{ scope.row.采集时间 }}
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent"
:page-sizes="[20, 40, 50, 100]"
:page-size="pageSize"
:total="total"
:small="true"
layout="total, sizes, prev, pager, next"
@size-change="handleSizeChanges"
@current-change="handleCurrentChanges"/>
</div>
</div>
<el-table v-if="dataType === 3" :data="tableData1" border size="small" stripe highlight-current-row height="740px" >
<el-table-column label="订单编号" prop="Zone" align="center" width="100px" >
<template slot-scope="scope">
{{ scope.row.订单编号 }}
</template>
</el-table-column>
<el-table-column label="加工时长" prop="TagName" align="center">
<el-table-column label="程序时长(min)" prop="Zone" align="center" width="120px" >
<template slot-scope="scope">
{{ scope.row.循环时间 }}
<span style="color: #0ba9e3">{{ scope.row.程序时长 }}</span>
</template>
</el-table-column>
<el-table-column label="采集时间" align="center" width="150px" >
<el-table-column label="最小时长(min)" prop="Zone" align="center" width="120px" >
<template slot-scope="scope">
{{ scope.row.采集时间 }}
{{ scope.row.最小时长 }}
</template>
</el-table-column>
<el-table-column label="最大时长(min)" prop="Zone" align="center" width="120px" >
<template slot-scope="scope">
{{ scope.row.最大时长 }}
</template>
</el-table-column>
<!-- <el-table-column label="频次/总数" prop="Zone" align="center" >-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.频次 }} / {{ scope.row.总记录数 }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="产品编码" prop="Zone" align="center">
<template slot-scope="scope">
{{ scope.row.产品编码 }}
</template>
</el-table-column>
<el-table-column label="产品名称" prop="Zone" align="center" >
<template slot-scope="scope">
{{ scope.row.产品名称 }}
</template>
</el-table-column>
</el-table>
<el-table v-if="dataType === 4" :data="tableData1" border size="small" stripe highlight-current-row height="740px" >
<el-table-column label="订单编号" prop="Zone" align="center" width="100px" >
<template slot-scope="scope">
{{ scope.row.订单编号 }}
</template>
</el-table-column>
<el-table-column label="换件时长(min)" prop="Zone" align="center" width="120px" >
<template slot-scope="scope">
<span style="color: #0ba9e3">{{ scope.row.换件时长 }}</span>
</template>
</el-table-column>
<el-table-column label="最小时长(min)" prop="Zone" align="center" width="120px" >
<template slot-scope="scope">
{{ scope.row.最小时长 }}
</template>
</el-table-column>
<el-table-column label="最大时长(min)" prop="Zone" align="center" width="120px" >
<template slot-scope="scope">
{{ scope.row.最大时长 }}
</template>
</el-table-column>
<!-- <el-table-column label="频次/总数" prop="Zone" align="center" >-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.频次 }} / {{ scope.row.总记录数 }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="产品编码" prop="Zone" align="center" >
<template slot-scope="scope">
{{ scope.row.产品编码 }}
</template>
</el-table-column>
<el-table-column label="产品名称" prop="Zone" align="center" >
<template slot-scope="scope">
{{ scope.row.产品名称 }}
</template>
</el-table-column>
</el-table>
</div>
</div>
@@ -120,6 +221,7 @@ export default {
completionTime: [],
routineCheckType: [],
dataType: 0,
orderNo: '',
loading: false,
dialogFormVisible: false,
title: '',
@@ -146,6 +248,7 @@ export default {
设备类型: [{ required: true, message: '请选择' }]
},
original: '',
currentRow: null,
total: 0, // 分页总数
tableData: [], // 设备信息表
tableData1: [], // 设备信息表
@@ -274,16 +377,31 @@ export default {
this.loading = true
this.tableData1 = []
this.dataType = row.数据类型
this.currentRow = row
var param = []
param.push(['PageCurrent', this.pageCurrent])
param.push(['PageSize', this.pageSize])
param.push(['PageCount', '1111', 'int', '1'])
param.push(['ItemCount', '1111', 'int', '1'])
param.push(['开始时间', this.completionTime[0]])
param.push(['结束时间', this.completionTime[1]])
param.push(['设备名称', this.equipmentType])
param.push(['参数名称', row.参数名称])
param.push(['数据类型', row.数据类型])
param.push(['订单编号', this.orderNo])
var Data = this.CreateData('11', '设备管理_设备数据_统计数据查询_通过类型', param)
this.ExecDatabase(Data).then(response => {
this.loading = false
this.tableData1 = row.数据类型 === 1 ? this.mergeContinuousStatus(response.data) : response.data
console.log(response.data)
if (row.数据类型 === 1) {
this.tableData1 = this.mergeContinuousStatus(response.data.result)
} else if (row.数据类型 === 2) {
this.tableData1 = response.data.result
this.total = parseInt(response.data.output[0].ItemCount)
} else {
this.tableData1 = response.data.result
}
// this.tableData = response.data.result
// this.total = parseInt(response.data.output[0].ItemCount)
}).catch(() => {
@@ -293,11 +411,11 @@ export default {
handleSizeChanges(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchTable()
this.handleSearch(this.currentRow)
},
handleCurrentChanges(val) {
this.pageCurrent = val
this.searchTable()
this.handleSearch(this.currentRow)
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -213,7 +213,7 @@
</el-button>
</template>
</el-table-column>
<el-table-column align="center" prop="备注" label="备注" width="150" />
<el-table-column align="center" prop="备注" label="备注" width="150" show-overflow-tooltip />
<el-table-column align="center" prop="未完成说明" label="未完成说明" width="120" />
<el-table-column align="center" prop="派工特殊说明" label="派工特殊备注" width="120" />
<el-table-column align="center" label="编辑" width="120">
@@ -221,6 +221,8 @@
<el-button type="text" size="mini" @click="editRemark(scope.row)">编辑</el-button>
</template>
</el-table-column>
<el-table-column align="center" prop="行文本备注" label="工艺备注" width="120" />
<el-table-column align="center" prop="任务概述" label="工艺说明" width="120" />
<el-table-column align="center" label="二次派工" width="200">
<template slot-scope="scope">
<el-select

View File

@@ -15,16 +15,16 @@
<el-input v-model="doneprocessName" placeholder="请输入工序名称" clearable style="width: 150px;margin-right: 10px" />
<br>
<br>
<span class="show-text">排产状态:</span>
<!-- <span class="show-text">排产状态:</span>
<el-select v-model="doneproductionStatus" clearable placeholder="请选择状态" style="width: 150px;margin-right: 10px">
<el-option label="全部" value="全部" />
<el-option label="已完成" value="已完成" />
<el-option label="未完成" value="未完成" />
</el-select>
</el-select> -->
<span class="show-text">要求完工日期:</span>
<el-date-picker
v-model="completionTime"
:clearable="false"
end-placeholder="结束时间"
format="yyyy-MM-dd"
popper-class="virtual-cell-time-picker"
@@ -36,26 +36,21 @@
<span class="show-text">计划开始:</span>
<el-date-picker
v-model="planStartTime"
:clearable="false"
end-placeholder="结束时间"
format="yyyy-MM-dd"
popper-class="virtual-cell-time-picker"
range-separator="-"
start-placeholder="开始时间"
style="width: 280px;vertical-align: top"
type="datetimerange"
placeholder="计划开始时间"
style="width: 150px;
vertical-align: top"
type="date"
value-format="yyyy-MM-dd" />
<span class="show-text">计划完成:</span>
<el-date-picker
v-model="planendTime"
:clearable="false"
end-placeholder="结束时间"
format="yyyy-MM-dd"
popper-class="virtual-cell-time-picker"
range-separator="-"
start-placeholder="开始时间"
style="width: 280px;vertical-align: top"
type="datetimerange"
placeholder="计划完成时间"
style="width: 150px;
vertical-align: top"
type="date"
value-format="yyyy-MM-dd" />
<el-button :disabled="loading" icon="el-icon-search" plain type="primary" @click="donesearchTable()">查询</el-button>
</div>
@@ -185,8 +180,10 @@
@click="getitemdata(scope.row.订单号)">查看</el-button>
</template>
</el-table-column>
<el-table-column align="center" prop="备注" label="备注" width="150" />
<el-table-column align="center" label="最晚开始" width="160">
<el-table-column align="center" prop="备注" label="备注" width="150" show-overflow-tooltip/>
<el-table-column align="center" prop="行文本备注" label="工艺备注" width="120" />
<el-table-column align="center" prop="任务概述" label="工艺说明" width="120" />
<!-- <el-table-column align="center" label="最晚开始" width="160">
<el-date-picker
v-model="scope.row.最晚开始时间"
type="date"
@@ -197,7 +194,7 @@
value-format="yyyy-MM-dd"
@change = "editlateTask">
</el-date-picker>
</el-table-column>
</el-table-column> -->
<!-- <el-table-column align="center" label="派工" width="100">
<template slot-scope="scope">
<el-button type="primary" size="mini"
@@ -375,8 +372,8 @@ export default {
station:'全部',
completids:[],
completionTime: [],
planStartTime: [],
planendTime: [],
planStartTime: '',
planendTime: '',
loading: false,
tableData: [],
donetableData: [],
@@ -770,13 +767,11 @@ export default {
// param.push(['性质', this.nature])
param.push(['要求完工日期1', this.completionTime[0]])
param.push(['要求完工日期2', this.completionTime[1]])
param.push(['计划开始1', this.planStartTime[0]])
param.push(['计划开始2', this.planStartTime[1]])
param.push(['计划完成1', this.planendTime[0]])
param.push(['计划完成2', this.planendTime[1]])
param.push(['计划开始', this.planStartTime])
param.push(['计划完成', this.planendTime])
param.push(['排产状态', this.productionStatus])
param.push(['指派对象', this.station])
var Data = this.CreateData('11', 'MES_OrderPlanned_Query', param,this.pageSize, this.pageCurrent)
var Data = this.CreateData('11', '机加已排产_获取任务列表', param,this.pageSize, this.pageCurrent)
this.ExecDatabase(Data).then(response => {
this.loading = false
@@ -825,16 +820,13 @@ export default {
param.push(['产品编码', this.doneproductCode])
param.push(['产品名称', this.doneproductName])
param.push(['工序名称', this.doneprocessName])
// param.push(['性质', this.donenature])
param.push(['要求完工日期1', this.completionTime[0]])
param.push(['要求完工日期2', this.completionTime[1]])
param.push(['计划开始1', this.planStartTime[0]])
param.push(['计划开始2', this.planStartTime[1]])
param.push(['计划完成1', this.planendTime[0]])
param.push(['计划完成2', this.planendTime[1]])
param.push(['计划开始', this.planStartTime])
param.push(['计划完成', this.planendTime])
param.push(['排产状态', this.doneproductionStatus])
param.push(['指派对象', this.station])
var Data = this.CreateData('11', 'MES_OrderPlanned_Query', param,this.pageSize, this.pageCurrent)
var Data = this.CreateData('11', '机加已排产_获取任务列表', param,this.pageSize, this.pageCurrent)
this.ExecDatabase(Data).then(response => {
this.loading = false
@@ -1491,4 +1483,5 @@ export default {
.el-picker-panel__icon-btn{
padding: 0;
}
</style>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -734,6 +734,7 @@ export default {
var orderids = []
var ordernums = []
var orderitems = []
multipleSelection.forEach(item => {
if(item.标准工艺 == 1 & item.生产工艺 !=1 ){
orderids.push(item.订单编号)
@@ -749,7 +750,7 @@ export default {
param.push(['订单编号',orderids])
param.push(['零件图号',orderitems])
param.push(['计划数量',ordernums])
console.log(param)
var Data = this.CreateData('12', '工艺管理_零件工序_生产工艺_批量生成生产工艺', param)
this.ExecDatabase(Data).then(response => {
this.searchTable()
@@ -1141,6 +1142,7 @@ export default {
this.ExecDatabase(Data1).then(response => {
param1[0] = ['物料编号', this.selectedRow.物料编号]
param1[1] = ['订单编号', this.selectedRow.订单编号]
this.$message.success('操作成功')
// 参数数量与名称要与存储过程对应
// var Data3 = this.CreateData('11', '工艺管理_生产工艺_查询生产工艺', param1)
// this.ExecDatabase(Data3).then(response => {

View File

@@ -796,6 +796,7 @@ export default {
this.ExecDatabase(Data1).then(response => {
var param3 = []
param3[0] = ['物料编号', this.partNameValue3]
this.$message.success('保存成功')
// 参数数量与名称要与存储过程对应
// var Data3 = this.CreateData('11', '车间生产管理工艺_零件工序_查询工序信息_工艺库', param3)
// this.ExecDatabase(Data3).then(response => {

File diff suppressed because it is too large Load Diff

View File

@@ -43,6 +43,13 @@
clearable
style="width: 150px; margin-right: 10px"
/>
<span class="show-text">物料名称:</span>
<el-input
v-model="productname2"
placeholder="请输入零件名称"
clearable
style="width: 150px; margin-right: 10px"
/>
<!-- <span class="show-text">计划开工:</span>
<el-date-picker
v-model="completionTime"
@@ -259,6 +266,14 @@
prop="工序名称"
label="工序名称"
width="80"
/>
<el-table-column
align="center"
prop="上序合格数"
label="上序合格数"
width="80"
/>
<!-- <el-table-column align="center" label="开工时间" width="100">
<template slot-scope="scope">{{formatDate(scope.row.开工时间)}}</template>
@@ -1442,7 +1457,7 @@
<el-input
v-model="item.编码"
size="mini"
style="width: 300px"
style="width: 250px"
readonly
/>
</span>
@@ -1453,7 +1468,7 @@
<el-input
v-model="item.数量"
size="mini"
style="width: 200px"
style="width: 100px"
readonly
/>
</span>
@@ -1464,7 +1479,18 @@
<el-input
v-model="item.退库数量"
size="mini"
style="width: 200px"
style="width: 100px"
/>
</span>
</div>
<div class="info-item">
<span class="info-label">备注</span>
<span class="info-value">
<el-input
v-model="item.LineText"
size="mini"
style="width: 100px"
/>
</span>
@@ -1825,6 +1851,7 @@ export default {
salenum:'',
contractNo: "",
productCode2: "",
productname2: "",
process: "",
processList2: [],
nature: "",
@@ -2703,6 +2730,7 @@ getUserId() {
param.push(["TaskAID", this.TaskAID || 0]);
param.push(["订单号", this.orderNo2 || 0]);
param.push(["零件编号", this.productCode2]);
param.push(["零件名称", this.productname2]);
param.push(["计划开工_Start", ""]);
param.push(["计划开工_End", ""]);
param.push(["生产状态", this.productionStatus2 || -1]);
@@ -3662,9 +3690,9 @@ async workendForm() {
['数量', element.退库数量],
['单位', element.单位],
['批次信息', element.批次信息],
['最后编辑人', this.$store.state.user.name]
['最后编辑人', this.$store.state.user.name],
['备注', element.LineText]
];
console.log(param)
return this.CreateData('12', '生产管理_加工中心_退库', param);
});

View File

@@ -2513,7 +2513,7 @@
<el-dialog
:visible.sync="ReturnWarehousepop"
title="退库单"
width="1300px"
width="1500px"
center
:close-on-click-modal="false"
>
@@ -2521,7 +2521,7 @@
<el-form-item v-for="item in ReturnWarehouseForm" :key="item.编码" >
<div class="info-container" >
<div class="info-item">
<span class="info-label">物料名称</span>
<span class="info-label" style="width: 80px">物料名称</span>
<span class="info-value">
<el-input
v-model="item.名称"
@@ -2532,22 +2532,43 @@
</span>
</div>
<div class="info-item">
<span class="info-label">物料编码</span>
<span class="info-label" style="width: 80px">物料编码</span>
<span class="info-value">
<el-input
v-model="item.编码"
size="mini"
readonly
style="width: 300px"
style="width: 250px"
/>
</span>
</div>
<div class="info-item">
<span class="info-label">数量</span>
<span class="info-label" style="width: 80px">发料数量</span>
<span class="info-value">
<el-input
v-model="item.数量"
size="mini"
style="width: 100px"
readonly
/>
</span>
</div>
<div class="info-item">
<span class="info-label" style="width: 80px">退库数量</span>
<span class="info-value">
<el-input
v-model="item.退库数量"
size="mini"
style="width: 100px"
/>
</span>
</div>
<div class="info-item">
<span class="info-label" style="width: 80px">备注</span>
<span class="info-value">
<el-input
v-model="item.LineText"
size="mini"
style="width: 200px"
/>
</span>
@@ -2569,7 +2590,7 @@
<el-dialog
:visible.sync="MaterialRequisitionpop"
title="领料单"
width="900px"
width="1200px"
center
:close-on-click-modal="false"
>
@@ -2577,23 +2598,44 @@
<el-form-item v-for="item in MaterialRequisitionForm.lines" :key="item.ItemNo" >
<div class="info-container" >
<div class="info-item">
<span class="info-label">物料名称</span>
<span class="info-label" style="width: 80px">物料名称</span>
<span class="info-value">
<el-input
v-model="item.ItemName"
size="mini"
readonly
style="width: 300px"
style="width: 200px"
/>
</span>
</div>
<div class="info-item">
<span class="info-label">数量</span>
<span class="info-label" style="width: 80px">物料编码</span>
<span class="info-value">
<el-input
v-model="item.ItemNo"
size="mini"
readonly
style="width: 250px"
/>
</span>
</div>
<div class="info-item">
<span class="info-label" style="width: 80px">数量</span>
<span class="info-value">
<el-input
v-model="item.Quantity"
size="mini"
style="width: 200px"
style="width: 150px"
/>
</span>
</div>
<div class="info-item">
<span class="info-label" style="width: 80px">备注</span>
<span class="info-value">
<el-input
v-model="item.LineText"
size="mini"
style="width: 150px"
/>
</span>
</div>
@@ -6394,7 +6436,10 @@ submitNewProcess() {
var Data = this.CreateData('11', '生产管理_加工中心_生产发料查询', param)
this.ExecDatabase(Data).then(response => {
console.log(response)
this.ReturnWarehouseForm = response.data
this.ReturnWarehouseForm = response.data.map(element => ({
...element,
退库数量: 0
}))
})
},
async MaterialRequisition(){
@@ -6489,16 +6534,17 @@ submitNewProcess() {
},
async submitReturnWare() {
const validData = this.ReturnWarehouseForm
.filter(element => element.数量 != 0)
.filter(element => element.退库数量 != 0)
.map(element => {
const param = [
['生产订单号', element.生产订单号],
['编码', element.编码],
['名称', element.名称],
['数量', element.数量],
['数量', element.退库数量],
['单位', element.单位],
['批次信息', element.批次信息],
['最后编辑人', this.$store.state.user.name]
['最后编辑人', this.$store.state.user.name],
['备注', element.LineText]
];
return this.CreateData('12', '生产管理_加工中心_退库', param);
});
@@ -6544,6 +6590,7 @@ submitNewProcess() {
param2.push(["external_num", item.DocumentAbsoluteEntry])
param2.push(["item_code", item.ItemNo]);
param2.push(["item_name", item.ItemName]);
param2.push(["line_memo", item.LineText]);
param2.push(["whs_code", ""]);
param2.push(["manage_type", 'B']);
param2.push(["price", 0]);

View File

@@ -87,6 +87,7 @@
@row-click="handleRowClick">
<el-table-column type="selection" width="50"></el-table-column>
<el-table-column label="序号" type="index" align="center" width="50"/>
<el-table-column label="状态" align="center" prop="单据状态" width="80" />
<el-table-column label="生产订单" align="center" prop="订单号" width="80" />
<el-table-column label="计划号" align="center" prop="计划号" width="80" />
<el-table-column label="工序名称" align="center" prop="工序名称" width="120"/>
@@ -1404,6 +1405,7 @@ shouldIncludeByExecutionStatus(mergedItem) {
this.$message.error('数量输入错误4')
return
}
this.receiveVisible = false;
// 获取订单行号最大的TaskAID
const maxTaskAID = this.getMaxOrderLineTaskAID(row);
params.push(["TaskAID", maxTaskAID]);
@@ -1441,7 +1443,7 @@ shouldIncludeByExecutionStatus(mergedItem) {
this.$message.error('数量输入错误')
return
}
this.doVisible = false;
// 获取订单行号最大的TaskAID
const maxTaskAID = this.getMaxOrderLineTaskAID(row);
params.push(["TaskAID", maxTaskAID]);

View File

@@ -135,7 +135,7 @@ export default {
},
mounted() {
this.searchTable()
// this.searchTable()
},
methods: {

View File

@@ -32,6 +32,12 @@
<el-option label="加急" value="加急" />
<el-option label="正常" value="正常" />
</el-select>
<span class="show-text">单据状态:</span>
<el-select v-model="orderStatus" clearable placeholder="请选择单据状态" style="width: 150px;margin-right: 10px">
<el-option label="全部" value="全部" />
<el-option label="关闭" value="关闭" />
<el-option label="正常" value="正常" />
</el-select>
<!-- 其他搜索条件保持不变 -->
<el-button :disabled="loading" icon="el-icon-search" plain type="primary" @click="searchTable()">查询</el-button>
@@ -48,6 +54,7 @@
<el-table-column align="center" label="序号" type="index" width="50" />
<el-table-column align="center" label="工序名称" prop="工序名称" width="100" />
<el-table-column align="center" label="计划数量" prop="计划数量" width="100" />
<el-table-column align="center" label="标准工时" prop="标准工时" width="100" />
<el-table-column align="center" label="指派对象" prop="指派对象" width="100" />
<!-- 在子数据中显示外协标识 -->
<!-- <el-table-column align="center" label="外协" width="80">
@@ -86,7 +93,7 @@
<!-- 主表列定义 -->
<el-table-column align="center" label="序号" type="index" width="50" />
<el-table-column align="center" prop="合同号" label="销售订单" width="120" />
<el-table-column align="center" prop="计划号" label="计划号" width="120" />
<el-table-column align="center" prop="订单号" label="生产订单" width="100" />
<el-table-column align="center" prop="产品编码" label="产品编码" width="220" />
<el-table-column align="center" prop="产品名称" label="产品名称" width="190" />
@@ -142,7 +149,12 @@
</template>
</el-table-column>
<el-table-column align="center" prop="当前序" label="当前序" width="80" />
<el-table-column align="center" prop="工艺路线" label="工艺路线" width="180" />
<el-table-column align="center" label="工艺路线" width="550">
<template slot-scope="scope">
<div class="process-route" v-html="formatProcessRoute(scope.row)" />
</template>
</el-table-column>
<el-table-column align="center" prop="计划号" label="计划号" width="120" />
</el-table>
</el-card>
<el-dialog
@@ -214,6 +226,7 @@ export default {
// 新增过滤字段
outsourceStatus: '全部', // 外协状态
urgentStatus: '全部', // 加急状态
orderStatus:'正常',
completionTime: [],
loading: false,
tableData: [],
@@ -276,6 +289,199 @@ export default {
if (!date) return ''
return date.split(' ').length > 1 ? date.split(' ')[0] : date
},
formatProcessRouteDate(date) {
const formattedDate = this.formatDate(date)
const match = formattedDate.match(/^(\d{4})-(\d{2})-(\d{2})$/)
return match ? `${match[2]}-${match[3]}` : formattedDate
},
toProcessNumber(value) {
const num = Number(value)
return Number.isFinite(num) ? num : 0
},
escapeProcessHtml(value) {
return String(value == null ? '' : value)
.replace(/&/g, '&amp;')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
.replace(/"/g, '&quot;')
.replace(/'/g, '&#39;')
},
isOutsourceProcess(process) {
return process.指派对象 === '外协' ||
String(process.工序名称 || '').includes('(外协)') ||
String(process.工序名称 || '').includes('(外协)')
},
getProcessStatusNum(status) {
const statusNum = parseInt(status)
if (Number.isFinite(statusNum)) {
return statusNum
}
const statusMap = {
辅助开始: 2,
辅助结束: 3,
开始加工: 4,
暂停: 5,
报工: 6,
装配加工: 4
}
return statusMap[status] || 0
},
isBlueProcess(process) {
const statusNum = this.getProcessStatusNum(process.加工状态)
const countNum = parseInt(process.收检合格数)
return statusNum === 6 || statusNum === 3 || countNum > 0
},
isGreenProcess(process) {
return this.isOutsourceProcess(process) &&
this.toProcessNumber(process.收料数量) > this.toProcessNumber(process.收检合格数) + this.toProcessNumber(process.收检不合格数)
},
getProcessBaseClass(process) {
if (this.isGreenProcess(process)) {
return 'process-route-green'
}
if (this.isBlueProcess(process)) {
return 'process-route-blue'
}
const statusNum = this.getProcessStatusNum(process.加工状态)
if (statusNum === 2 || statusNum === 4) {
return 'process-route-green'
}
return 'process-route-red'
},
getOutsourceGroupClassState(processes) {
const classes = new Map()
let currentIndexes = []
let lastProcess = null
const flushOutsourceRun = () => {
if (currentIndexes.length > 0 && lastProcess) {
const className = this.getProcessBaseClass(lastProcess)
currentIndexes.forEach(index => classes.set(index, className))
}
currentIndexes = []
lastProcess = null
}
const isSameContinuousGroup = process => {
if (!lastProcess) {
return true
}
const lineNo = this.toProcessNumber(process.订单行号)
const lastLineNo = this.toProcessNumber(lastProcess.订单行号)
return lineNo === lastLineNo + 1 &&
String(process.外协分组 || '') === String(lastProcess.外协分组 || '')
}
processes.forEach((process, index) => {
if (!this.isOutsourceProcess(process)) {
flushOutsourceRun()
return
}
if (!isSameContinuousGroup(process)) {
flushOutsourceRun()
}
currentIndexes.push(index)
lastProcess = process
})
flushOutsourceRun()
return classes
},
getProcessClass(process, index, outsourceGroupClasses) {
if (this.isOutsourceProcess(process)) {
return outsourceGroupClasses.get(index) || this.getProcessBaseClass(process)
}
return this.getProcessBaseClass(process)
},
getProcessRouteName(process) {
const name = String(process.工序名称 || '')
const assignee = String(process.指派对象 || '')
if (!assignee || name.includes(`(${assignee})`) || name.includes(`${assignee}`)) {
return name
}
return `${name}(${assignee})`
},
getRouteProcesses(row) {
if (Array.isArray(row.子数据) && row.子数据.length > 0) {
return row.子数据
}
return String(row.工艺路线 || '')
.split(',')
.map(name => name.trim())
.filter(Boolean)
.map(name => ({
工序名称: name,
加工状态: 0,
收检合格数: 0,
计划开始时间: '',
指派对象: '',
订单行号: 0,
收料数量: 0,
收检不合格数: 0
}))
},
formatProcessRoute(row) {
const processes = this.getRouteProcesses(row)
if (processes.length === 0) {
return ''
}
const outsourceGroupClasses = this.getOutsourceGroupClassState(processes)
const maxPerRow = 8
const rows = Math.ceil(processes.length / maxPerRow)
let tableHtml = '<div class="process-route-wrap"><table class="process-route-table"><tbody>'
for (let rowIndex = 0; rowIndex < rows; rowIndex++) {
const startIndex = rowIndex * maxPerRow
const endIndex = Math.min(startIndex + maxPerRow, processes.length)
const rowProcesses = processes.slice(startIndex, endIndex)
if (rowIndex > 0) {
tableHtml += '<tr class="process-route-spacer"><td colspan="' + (maxPerRow * 2 - 1) + '"></td></tr>'
}
tableHtml += '<tr>'
rowProcesses.forEach((process, index) => {
const className = this.getProcessClass(process, startIndex + index, outsourceGroupClasses)
const planDate = this.formatProcessRouteDate(process.计划开始时间 || process.计划完成时间 || '')
tableHtml += `<td class="process-route-date ${className}">${this.escapeProcessHtml(planDate)}</td>`
if (index < rowProcesses.length - 1) {
tableHtml += '<td class="process-route-arrow-hidden"></td>'
}
})
tableHtml += '</tr>'
tableHtml += '<tr>'
rowProcesses.forEach((process, index) => {
const className = this.getProcessClass(process, startIndex + index, outsourceGroupClasses)
const name = this.getProcessRouteName(process)
tableHtml += `<td class="${className}">${this.escapeProcessHtml(name)}</td>`
if (index < rowProcesses.length - 1) {
tableHtml += '<td class="process-route-arrow">→</td>'
}
})
tableHtml += '</tr>'
tableHtml += '<tr>'
rowProcesses.forEach((process, index) => {
const className = this.getProcessClass(process, startIndex + index, outsourceGroupClasses)
const count = this.toProcessNumber(process.收检合格数)
tableHtml += `<td class="process-route-count ${className}">合格${this.escapeProcessHtml(count)}</td>`
if (index < rowProcesses.length - 1) {
tableHtml += '<td class="process-route-arrow-hidden"></td>'
}
})
tableHtml += '</tr>'
}
tableHtml += '</tbody></table></div>'
return tableHtml
},
mergeOrderData(dataList) {
// 第一步:先按照订单行号对原始数据进行排序
const sortedDataList = [...dataList].sort((a, b) => {
@@ -307,6 +513,7 @@ export default {
进度: item.进度,
拆分内码: item.拆分内码,
计划数量: item.计划数量,
标准工时: item.标准工时,
开工时间: item.开工时间,
完成数量: item.完成数量,
收料数量: item.收料数量,
@@ -322,7 +529,8 @@ export default {
订单行号: item.订单行号,
加急总数:item.加急总数,
外协结束时间:item.外协结束时间,
开始时间:item.开始时间
开始时间:item.开始时间,
外协分组: item.外协分组
}]
})
} else {
@@ -345,6 +553,7 @@ export default {
进度: item.进度,
拆分内码: item.拆分内码,
计划数量: item.计划数量,
标准工时: item.标准工时,
开工时间: item.开工时间,
完成数量: item.完成数量,
收料数量: item.收料数量,
@@ -362,6 +571,7 @@ export default {
开始时间:item.开始时间,
结束时间:item.结束时间,
外协结束时间:item.外协结束时间,
外协分组: item.外协分组
})
// 对子数据按照订单行号排序
@@ -477,6 +687,7 @@ export default {
param.push(['指派对象', '全部'])
param.push(['计划号', this.plannum])
param.push(['加急状态', this.urgentStatus])
param.push(['单据状态', this.orderStatus])
// // 添加外协状态过滤条件
// if (this.outsourceStatus !== '全部') {
// param.push(['是否外协', this.outsourceStatus === '是' ? 1 : 0])
@@ -606,6 +817,78 @@ export default {
width: 120px;
display: inline-flex;
}
.process-route {
line-height: 1.4;
white-space: normal;
word-break: break-all;
}
::v-deep .process-route-wrap {
width: 100%;
text-align: left;
}
::v-deep .process-route-table {
width: auto;
border-collapse: collapse;
text-align: left;
table-layout: auto;
}
::v-deep .process-route-table td {
text-align: left;
padding: 2px 2px;
font-size: 11px;
white-space: nowrap;
line-height: 1.4;
}
::v-deep .process-route-date {
font-size: 10px !important;
color: #8899aa !important;
padding: 2px 2px !important;
}
::v-deep .process-route-count {
font-weight: 700;
font-size: 12px !important;
}
::v-deep .process-route-spacer td {
height: 4px;
padding: 0 !important;
line-height: 1 !important;
}
::v-deep .process-route-green {
color: #28d961;
font-weight: 700;
}
::v-deep .process-route-blue {
color: #09a8ff;
font-weight: 700;
}
::v-deep .process-route-red {
color: #ff3f37;
font-weight: 700;
}
::v-deep .process-route-arrow {
color: rgba(0, 164, 255, 0.6) !important;
font-size: 10px !important;
padding: 2px 0 !important;
width: 8px;
text-align: center !important;
}
::v-deep .process-route-arrow-hidden {
padding: 2px 0 !important;
width: 8px;
}
.search-container {
margin-bottom: 20px;
}
@@ -679,4 +962,7 @@ export default {
display: flex;
align-items: center;
}
</style>
.el-table tr{
background-color: initial;
}
</style>

View File

@@ -97,6 +97,7 @@
@row-click="handleRowClick">
<el-table-column type="selection" width="50"></el-table-column>
<!-- <el-table-column label="序号" type="index" align="center" width="50"/> -->
<el-table-column label="单据状态" align="center" prop="单据状态" width="80" />
<el-table-column label="生产订单" align="center" prop="订单号" width="80" />
<!-- <el-table-column label="计划号" align="center" prop="计划号" width="80" /> -->
<el-table-column label="物料名称" align="center" prop="产品名称" width="120"/>

View File

@@ -12,6 +12,21 @@
<el-input v-model="searchForm.processName" placeholder="请输入工序" clearable style="width: 100px; margin-right: 10px" />
<span class="show-text">订单号:</span>
<el-input v-model="searchForm.orderNo" placeholder="请输入订单号" clearable style="width: 100px; margin-right: 10px" />
<span class="show-text">工时类型:</span>
<el-select v-model="searchForm.workHoursType" placeholder="请选择" clearable style="width: 100px; margin-right: 10px">
<el-option label="装配" value="装配" />
<el-option label="电气" value="电气" />
<el-option label="机加" value="机加" />
<el-option label="质检" value="质检" />
<el-option label="技术" value="技术" />
<el-option label="计划" value="计划" />
<el-option label="库房" value="库房" />
<el-option label="采购" value="采购" />
<el-option label="销售" value="销售" />
<el-option label="售后" value="售后" />
<el-option label="工艺" value="工艺" />
<el-option label="其他" value="其他" />
</el-select>
<span class="show-text">报工开始日期:</span>
<el-date-picker
v-model="searchForm.startDate"
@@ -64,20 +79,49 @@
{{ scope.row.level === 1 ? scope.row.materialCode : '' }}
</template>
</el-table-column>
<el-table-column prop="计划数量" label="计划数量" width="120" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.level === 2 ? scope.row.计划数量 : '' }}
</template>
</el-table-column>
<el-table-column prop="工序说明" label="工序说明" width="120" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.level === 2 ? scope.row.工序说明 : '' }}
</template>
</el-table-column>
<el-table-column prop="工时类型" label="工时类型" width="120" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.level === 2 ? getWorkHoursType(scope.row) : '' }}
</template>
</el-table-column>
<el-table-column prop="workHours" label="工时(h)" width="100" align="center">
<template slot-scope="scope">
<span :class="{'bold-text': scope.row.level === 1}">{{ scope.row.workHours }}</span>
</template>
</el-table-column>
<el-table-column prop="operator" label="操作人" width="100" align="center">
<template slot-scope="scope">
{{ scope.row.level === 2 ? scope.row.operator : '' }}
</template>
</el-table-column>
<el-table-column prop="planStart" label="开始时间" width="110" align="center" />
<el-table-column prop="planEnd" label="结束时间" width="110" align="center" />
<el-table-column prop="订单号" label="订单编号" width="120" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.level === 2 ? scope.row.订单号 : '' }}
</template>
</el-table-column>
<el-table-column prop="processName" label="工序名称" width="120" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.level === 2 ? scope.row.processName : '' }}
</template>
</el-table-column>
<el-table-column prop="operator" label="操作人" width="100" align="center">
<el-table-column prop="指派对象" label="指派对象" width="120" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.level === 2 ? scope.row.operator : '' }}
{{ scope.row.level === 2 ? scope.row.指派对象 : '' }}
</template>
</el-table-column>
@@ -85,15 +129,9 @@
<el-table-column prop="reportQty" label="报工数量" width="90" align="center" />
<el-table-column prop="planStart" label="计划开始" width="110" align="center" />
<el-table-column prop="planEnd" label="计划完成" width="110" align="center" />
<el-table-column prop="workHours" label="工时(h)" width="100" align="center">
<template slot-scope="scope">
<span :class="{'bold-text': scope.row.level === 1}">{{ scope.row.workHours }}</span>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
@@ -120,17 +158,7 @@
</template>
</el-table-column>
<el-table-column prop="reportCount" label="报工次数" width="90" align="center">
<template slot-scope="scope">
<span :class="{'bold-text': scope.row.level <= 2}">{{ scope.row.level <= 2 ? scope.row.reportCount : '' }}</span>
</template>
</el-table-column>
<el-table-column prop="reportQty" label="报工数量" width="90" align="center">
<template slot-scope="scope">
<span :class="{'bold-text': scope.row.level <= 2}">{{ scope.row.reportQty }}</span>
</template>
</el-table-column>
<el-table-column prop="contractNo" label="合同号" width="130" show-overflow-tooltip>
<template slot-scope="scope">
@@ -155,13 +183,16 @@
{{ scope.row.level === 3 ? scope.row.productName : '' }}
</template>
</el-table-column>
<el-table-column prop="processName" label="工序名称" width="90" show-overflow-tooltip>
<el-table-column prop="计划数量" label="计划数量" width="100" align="center">
<template slot-scope="scope">
{{ scope.row.level === 3 ? scope.row.processName : '' }}
{{ scope.row.level === 3 ? scope.row.计划数量 : '' }}
</template>
</el-table-column>
<el-table-column prop="工序说明" label="工序说明" width="100" align="center">
<template slot-scope="scope">
<span :class="{'bold-text': scope.row.level === 3}">{{ scope.row.工序说明 }}</span>
</template>
</el-table-column>
<el-table-column prop="startTime" label="开始时间" width="150" align="center">
<template slot-scope="scope">
{{ scope.row.level === 3 ? scope.row.startTime : '' }}
@@ -179,21 +210,46 @@
<span :class="{'bold-text': scope.row.level <= 2}">{{ scope.row.workHours }}</span>
</template>
</el-table-column>
<el-table-column prop="processName" label="工序名称" width="90" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.level === 3 ? scope.row.processName : '' }}
</template>
</el-table-column>
<el-table-column prop="工时类型" label="工时类型" width="100" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.level === 3 ? getWorkHoursType(scope.row) : '' }}
</template>
</el-table-column>
<el-table-column prop="指派对象" label="指派对象" width="120" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.level === 3 ? scope.row.指派对象 : '' }}
</template>
</el-table-column>
<el-table-column prop="操作类别" label="类型" width="100" align="center">
<template slot-scope="scope">
<span :class="{'bold-text': scope.row.level === 3}">{{ scope.row.操作类别 }}</span>
</template>
</el-table-column>
<el-table-column prop="工序说明" label="工序说明" width="100" align="center">
<template slot-scope="scope">
<span :class="{'bold-text': scope.row.level === 3}">{{ scope.row.工序说明 }}</span>
</template>
</el-table-column>
<el-table-column prop="异常说明" label="异常说明" width="100" align="center">
<template slot-scope="scope">
<span :class="{'bold-text': scope.row.level === 3}">{{ scope.row.异常说明 }}</span>
</template>
</el-table-column>
<el-table-column prop="reportCount" label="报工次数" width="90" align="center">
<template slot-scope="scope">
<span :class="{'bold-text': scope.row.level <= 2}">{{ scope.row.level <= 2 ? scope.row.reportCount : '' }}</span>
</template>
</el-table-column>
<el-table-column prop="reportQty" label="报工数量" width="90" align="center">
<template slot-scope="scope">
<span :class="{'bold-text': scope.row.level <= 2}">{{ scope.row.reportQty }}</span>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
@@ -234,31 +290,32 @@
{{ scope.row.level === 1 ? scope.row.productName : '' }}
</template>
</el-table-column>
<el-table-column prop="processName" label="工序名称" width="90" show-overflow-tooltip>
<el-table-column prop="计划数量" label="计划数量" width="100" align="center">
<template slot-scope="scope">
{{ scope.row.level === 1 ? scope.row.processName : '' }}
{{ scope.row.level <= 2 ? scope.row.计划数量 : '' }}
</template>
</el-table-column>
<el-table-column prop="工序说明" label="工序说明" width="100" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.level <= 2 ? scope.row.工序说明 : '' }}
</template>
</el-table-column>
<el-table-column prop="工时类型" label="工时类型" width="100" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.level <= 2 ? getWorkHoursType(scope.row) : '' }}
</template>
</el-table-column>
<el-table-column prop="workHours" label="工时(h)" width="100" align="center">
<template slot-scope="scope">
<span :class="{'bold-text': scope.row.level === 1}">{{ scope.row.workHours }}</span>
</template>
</el-table-column>
<el-table-column prop="operator" label="操作人" width="100" align="center">
<template slot-scope="scope">
{{ scope.row.level === 2 ? scope.row.operator : '' }}
</template>
</el-table-column>
<el-table-column prop="qty" label="计划/完成" width="100" align="center">
<template slot-scope="scope">
<span :class="{'bold-text': scope.row.level === 1}">{{ scope.row.level === 1 ? scope.row.qty : '' }}</span>
</template>
</el-table-column>
<el-table-column prop="reportQty" label="报工数量" width="90" align="center">
<template slot-scope="scope">
<span :class="{'bold-text': scope.row.level === 1}">{{ scope.row.reportQty }}</span>
</template>
</el-table-column>
<el-table-column prop="startTime" label="开始时间" width="150" align="center">
<template slot-scope="scope">
{{ scope.row.level === 2 ? scope.row.startTime : '' }}
@@ -271,11 +328,34 @@
</template>
</el-table-column>
<el-table-column prop="workHours" label="工时(h)" width="100" align="center">
<el-table-column prop="processName" label="工序名称" width="90" show-overflow-tooltip>
<template slot-scope="scope">
<span :class="{'bold-text': scope.row.level === 1}">{{ scope.row.workHours }}</span>
{{ scope.row.level === 1 ? scope.row.processName : '' }}
</template>
</el-table-column>
<el-table-column prop="指派对象" label="指派对象" width="120" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.level === 2 ? scope.row.指派对象 : '' }}
</template>
</el-table-column>
<el-table-column prop="qty" label="计划/完成" width="100" align="center">
<template slot-scope="scope">
<span :class="{'bold-text': scope.row.level === 1}">{{ scope.row.level === 1 ? scope.row.qty : '' }}</span>
</template>
</el-table-column>
<el-table-column prop="reportQty" label="报工数量" width="90" align="center">
<template slot-scope="scope">
<span :class="{'bold-text': scope.row.level === 1}">{{ scope.row.reportQty }}</span>
</template>
</el-table-column>
<el-table-column prop="workHours" label="类型" width="100" align="center">
<template slot-scope="scope">
<span :class="{'bold-text': scope.row.level === 1}">{{ scope.row.操作类别 }}</span>
@@ -307,17 +387,7 @@
</template>
</el-table-column>
<el-table-column prop="reportCount" label="报工次数" width="90" align="center">
<template slot-scope="scope">
<span :class="{'bold-text': scope.row.level <= 2}">{{ scope.row.level <= 2 ? scope.row.reportCount : '' }}</span>
</template>
</el-table-column>
<el-table-column prop="reportQty" label="报工数量" width="90" align="center">
<template slot-scope="scope">
<span :class="{'bold-text': scope.row.level <= 2}">{{ scope.row.reportQty }}</span>
</template>
</el-table-column>
<el-table-column prop="contractNo" label="合同号" width="130" show-overflow-tooltip>
<template slot-scope="scope">
@@ -342,13 +412,16 @@
{{ scope.row.level === 3 ? scope.row.productName : '' }}
</template>
</el-table-column>
<el-table-column prop="processName" label="工序名称" width="90" show-overflow-tooltip>
<el-table-column prop="计划数量" label="计划数量" width="100" align="center">
<template slot-scope="scope">
{{ scope.row.level === 3 ? scope.row.processName : '' }}
{{ scope.row.level === 3 ? scope.row.计划数量 : '' }}
</template>
</el-table-column>
<el-table-column prop="reportQty" label="报工数量" width="90" align="center">
<template slot-scope="scope">
<span :class="{'bold-text': scope.row.level <= 2}">{{ scope.row.reportQty }}</span>
</template>
</el-table-column>
<el-table-column prop="startTime" label="开始时间" width="150" align="center">
<template slot-scope="scope">
{{ scope.row.level === 3 ? scope.row.startTime : '' }}
@@ -367,6 +440,39 @@
</template>
</el-table-column>
<el-table-column prop="processName" label="工序名称" width="90" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.level === 3 ? scope.row.processName : '' }}
</template>
</el-table-column>
<el-table-column prop="班次" label="班次" width="80" align="center">
<template slot-scope="scope">
{{ scope.row.level === 3 ? scope.row.班次 : '' }}
</template>
</el-table-column>
<el-table-column prop="报工类型" label="报工类型" width="100" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.level === 3 ? scope.row.报工类型 : '' }}
</template>
</el-table-column>
<el-table-column prop="指派对象" label="指派对象" width="120" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.level === 3 ? scope.row.指派对象 : '' }}
</template>
</el-table-column>
<el-table-column prop="reportCount" label="报工次数" width="90" align="center">
<template slot-scope="scope">
<span :class="{'bold-text': scope.row.level <= 2}">{{ scope.row.level <= 2 ? scope.row.reportCount : '' }}</span>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
</el-tabs>
@@ -374,6 +480,13 @@
<!-- 底部汇总 -->
<div class="summary-footer">
<span>总工时<strong>{{ currentTotalWorkHours }}</strong> 小时</span>
<span
v-for="item in currentWorkHoursTypeSummary"
:key="item.type"
class="type-summary-item"
>
{{ item.type }}<strong>{{ item.workHours }}</strong> 小时
</span>
</div>
</el-card>
</div>
@@ -391,6 +504,7 @@ export default {
productCode: '',
processName: '',
orderNo: '',
workHoursType: '',
startDate: '',
endDate: ''
},
@@ -425,6 +539,19 @@ export default {
return sum + (parseFloat(item.workHours) || 0)
}, 0)
return total.toFixed(1)
},
currentWorkHoursTypeSummary() {
const summaryMap = new Map()
this.getCurrentSummaryItems().forEach(item => {
const type = this.getWorkHoursType(item)
const workHours = parseFloat(item.workHours) || 0
summaryMap.set(type, (summaryMap.get(type) || 0) + workHours)
})
return Array.from(summaryMap, ([type, workHours]) => ({
type,
workHours: workHours.toFixed(1)
}))
}
},
@@ -433,6 +560,29 @@ export default {
},
methods: {
getWorkHoursType(row) {
return row.工时类型 || row.workType || row.WorkType || row.workHoursType || row.WorkHoursType || '未分类'
},
getCurrentSummaryItems() {
const items = []
if (this.activeTab === 'project') {
this.projectTableData.forEach(parent => {
items.push(...(parent.children || []))
})
} else if (this.activeTab === 'operator') {
this.operatorTableData.forEach(operator => {
;(operator.children || []).forEach(date => {
items.push(...(date.children || []))
})
})
} else if (this.activeTab === 'task') {
this.taskTableData.forEach(task => {
items.push(...(task.children || []))
})
}
return items
},
handleSearch() {
// 校验日期是否已选择
// if (!this.searchForm.startDate || !this.searchForm.endDate) {
@@ -470,6 +620,7 @@ export default {
['产品编码', this.searchForm.productCode || ''],
['工序名称', this.searchForm.processName || ''],
['订单号', this.searchForm.orderNo || ''],
['工时类型', this.searchForm.workHoursType || ''],
['开始日期', this.searchForm.startDate || ''],
['结束日期', this.searchForm.endDate || '']
]
@@ -510,13 +661,17 @@ export default {
materialCode: row.materialCode,
processName: row.processName,
operator: row.operator,
指派对象: row.指派对象,
qty: row.qty,
reportQty: row.reportQty,
planStart: row.planStart,
planEnd: row.planEnd,
workHours: row.workHours,
订单号:row.订单号,
操作类别 :row.操作类别
操作类别 :row.操作类别,
工时类型: this.getWorkHoursType(row),
计划数量: row.计划数量,
工序说明: row.工序说明
})
}
})
@@ -540,6 +695,7 @@ export default {
['产品编码', this.searchForm.productCode || ''],
['工序名称', this.searchForm.processName || ''],
['订单号', this.searchForm.orderNo || ''],
['工时类型', this.searchForm.workHoursType || ''],
['开始日期', this.searchForm.startDate || ''],
['结束日期', this.searchForm.endDate || '']
]
@@ -613,6 +769,12 @@ export default {
productCode: row.productCode,
productName: row.productName,
processName: row.processName,
计划数量: row.计划数量,
工序说明: row.工序说明,
工时类型: this.getWorkHoursType(row),
班次: row.班次,
报工类型: row.报工类型,
指派对象: row.指派对象,
reportQty: row.reportQty,
startTime: row.startTime,
endTime: row.endTime,
@@ -643,6 +805,7 @@ export default {
['产品编码', this.searchForm.productCode || ''],
['工序名称', this.searchForm.processName || ''],
['订单号', this.searchForm.orderNo || ''],
['工时类型', this.searchForm.workHoursType || ''],
['开始日期', this.searchForm.startDate || ''],
['结束日期', this.searchForm.endDate || '']
]
@@ -661,7 +824,7 @@ export default {
flatData.forEach((row, index) => {
if (row.Level === 1) {
const key = `${row.contractNo}_${row.productCode}_${row.processName}`
const key = `${row.contractNo}_${row.orderNo}_${row.productCode}_${row.processName}_${this.getWorkHoursType(row)}_${row.操作类别 || ''}`
level1Map.set(key, {
id: `t-${index}`,
level: 1,
@@ -670,6 +833,9 @@ export default {
productCode: row.productCode,
productName: row.productName,
processName: row.processName,
计划数量: row.计划数量,
工序说明: row.工序说明,
工时类型: this.getWorkHoursType(row),
qty: row.qty,
reportQty: row.reportQty,
workHours: row.workHours,
@@ -680,9 +846,14 @@ export default {
id: `t-${index}`,
level: 2,
contractNo: row.contractNo,
orderNo: row.orderNo,
productCode: row.productCode,
processName: row.processName,
计划数量: row.计划数量,
工序说明: row.工序说明,
工时类型: this.getWorkHoursType(row),
operator: row.operator,
指派对象: row.指派对象,
reportQty: row.reportQty,
startTime: row.startTime,
endTime: row.endTime,
@@ -694,7 +865,7 @@ export default {
// 12级关联
level2Items.forEach(item => {
const key = `${item.contractNo}_${item.productCode}_${item.processName}`
const key = `${item.contractNo}_${item.orderNo}_${item.productCode}_${item.processName}_${this.getWorkHoursType(item)}_${item.操作类别 || ''}`
const parent = level1Map.get(key)
if (parent) {
parent.children.push(item)
@@ -846,8 +1017,16 @@ export default {
border-top: 1px solid #ebeef5;
font-size: 13px;
color: #606266;
height: 40px;
min-height: 40px;
line-height: 20px;
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 8px 20px;
}
.type-summary-item {
white-space: nowrap;
}
/* 调整展开图标 */

File diff suppressed because it is too large Load Diff

View File

@@ -59,7 +59,10 @@
</el-select>
<el-button :disabled="!!loading" icon="el-icon-search" plain type="primary" @click="searchTable()">查询</el-button>
<el-button :disabled="!!multipleSelection.length === 0 || loading" icon="el-icon-check" plain type="success" style="width: 100px;" @click="batchValidate">一键校验</el-button>
<el-button :disabled=" uesrname != '付延辉'" icon="el-icon-check" plain type="danger" style="width: 100px;" @click="saveValidationRecord2(multipleSelection)">直接校验</el-button>
<el-button :disabled=" uesrname != '付延辉'" icon="el-icon-check" plain type="danger" style="position: absolute;
width: 100px;
right: 36px;
top: 70px;width: 100px;" @click="saveValidationRecord2(multipleSelection)">直接校验</el-button>
<!-- <el-button :disabled="!!loading" icon="el-icon-plus" plain type="warning" style="width: 130px;" @click="addWorkTimeRecord">新增工时记录</el-button> -->
</div>
@@ -230,11 +233,11 @@
@change="calculateWorkTime" />
</el-form-item>
<!-- <el-form-item label="加工工时">
<el-form-item label="加工工时">
<el-input v-model="editForm.加工工时" readonly>
<template slot="append"></template>
</el-input>
</el-form-item> -->
</el-form-item>
<el-form-item label="人员工时">
<el-input v-model="editForm.总时长" readonly>
<template slot="append"></template>
@@ -728,6 +731,40 @@ async uploadToSAP(record, detail) {
// ========== 9. 提交工时单据到SAP ==========
if (params.length > 0) {
try {
await new Promise(resolve => setTimeout(resolve, 500))
const reorderResult = await getB1("/ProductionOrders", {
"$filter": `AbsoluteEntry eq ${record.订单编号}`
})
if (!reorderResult.success || !reorderResult.data?.value?.length) {
return { success: false, error: '重新获取生产订单失败' }
}
const updatedOrder = reorderResult.data.value[0]
const lines = updatedOrder.ProductionOrderLines || []
lines.forEach(line => {
const matched = params.find(param => Number(line.LineNumber) === Number(param.BaseLine))
if (matched) {
line.PlannedQuantity = Number(line.IssuedQuantity) + Number(matched.Quantity)
}
})
const patchResult = await patchB1(`ProductionOrders(${updatedOrder.AbsoluteEntry})`, {
ProductionOrderLines: lines,
ProductionOrdersStages: updatedOrder.ProductionOrdersStages || []
})
if (!patchResult.success) {
this.$message.error(patchResult.message)
return { success: false, error: patchResult.message || '更新生产订单PlannedQuantity失败' }
}
} catch (reorderError) {
console.warn(`重新获取订单数据失败:`, reorderError)
return { success: false, error: reorderError.message || '更新生产订单PlannedQuantity异常' }
}
try {
const startDate = record.开始时间 ? record.开始时间.split(' ')[0] : this.currentdate
const result = await postB1("/InventoryGenExits", {

View File

@@ -215,7 +215,7 @@
</el-input>
</el-form-item>
<el-form-item label="班次标准工时">
<el-input v-model="editForm.班次标准工时" readonly />
<el-input v-model="editForm.当日班次最小标准工时" />
</el-form-item>
<!-- <el-form-item label="工序顺序">
<el-input v-model="editForm.工艺顺序" readonly />
@@ -682,7 +682,7 @@ export default {
加工工时: row.加工工时 || 0,
总时长: row.总时长 || 0,
工艺顺序: row.订单行号 || 0,
当日班次最小标准工时 : row.当日班次最小标准工时 || 0
当日班次最小标准工时 : row.当日班次最小标准工时 || 8
}
this.editDialogVisible = true
},

View File

@@ -175,6 +175,7 @@
style="width: 100%; margin-top: 20px"
tooltip-effect="dark"
@row-click="handleRowClick"
:row-class-name="tableRowClassName"
>
<el-table-column
align="center"
@@ -743,6 +744,14 @@ export default {
this.loading = false;
if (response.data.rows && response.data.rows.length !== 0) {
this.tableData = response.data.rows;
this.tableData.sort((a, b) => {
const aIsUrgent = a.加急状态 === '1';
const bIsUrgent = b.加急状态 === '1';
if (aIsUrgent && !bIsUrgent) return -1;
if (!aIsUrgent && bIsUrgent) return 1;
return 0;
});
this.total = response.data.total
} else {
this.tableData = [];
@@ -1122,10 +1131,27 @@ export default {
const seconds = String(date.getSeconds()).padStart(2, "0");
return `${year}${month}${day}_${hours}${minutes}${seconds}`;
},
tableRowClassName({ row, rowIndex }) {
const isUrgent = row.加急状态 == "1";
if (isUrgent) {
return "priority-row";
}
return "";
},
},
};
</script>
<style scoped>
::v-deep .priority-row {
background-color: #f56c6c !important;
color: #000000 !important;
}
::v-deep .priority-row td {
background-color: #f56c6c !important;
color: #000000 !important;
border: #f56c6c;
}
</style>
<style>
.search-container {
margin-bottom: 20px;
@@ -1343,4 +1369,4 @@ button {
width: 20px;
height: 20px;
}
</style>
</style>

View File

@@ -221,6 +221,18 @@
width="80"
prop="工位名称"
/>
<el-table-column
align="center"
label="供应商"
width="80"
prop="供应商"
/>
<el-table-column
align="center"
label="采购收货单"
width="100"
prop="采购收货单"
/>
<el-table-column
align="center"
label="加急数量"
@@ -273,7 +285,7 @@
width="180"
prop="检测说明"
/>
<el-table-column label="操作" align="center" width="250" fixed="right">
<el-table-column label="操作" align="center" width="350" fixed="right">
<template slot-scope="scope">
<el-button
class="operation-btn"
@@ -287,9 +299,15 @@
type="primary"
size="mini"
@click="getitemdraw(scope.row)"
>图纸</el-button
>零件图纸</el-button
>
<el-button
class="operation-btn"
type="primary"
size="mini"
@click="getitemdraw2(scope.row)"
>工艺图纸</el-button
>
</template>
</el-table-column>
@@ -586,31 +604,23 @@ export default {
this.$message.error('未上传图纸');
}
})
// this.ExecDatabase(Data).then(async (response) => {
// console.log(response);
// if (response.data.length > 0) {
// var pdfSrc = "" + this.downPDF + "" + response.data[0].uid + ".pdf";
// // 1. 先打开对话框
// this.seeVisible = true;
// // 2. 等待对话框完全渲染(使用 $nextTick 确保 DOM 已更新)
// await this.$nextTick();
// // 3. 等待一小段时间确保对话框内的容器完全渲染
// setTimeout(async () => {
// try {
// await seepdf(pdfSrc, 'see');
// } catch (error) {
// console.error('PDF 渲染失败:', error);
// this.$message.error('PDF 渲染失败: ' + error.message);
// }
// }, 300); // 增加延迟确保 DOM 完全渲染
// } else {
// this.$message.error('未上传图纸');
// }
// });
},
getitemdraw2(row) {
var param = [];
param[0] = ['物料编号', row.零件编码];
var Data = this.CreateData('11', '工艺管理_工艺维护_查看图纸', param);
this.ExecDatabase(Data).then(response => {
console.log(response)
if (response.data.length > 0) {
var pdfSrc =""+this.downPDF+""+ response.data[0].uid+".pdf"
window.open(pdfSrc,'_blank')
}else {
this.$message.error('未上传图纸');
}
})
},
Urgent(row){
var param = []
@@ -813,6 +823,7 @@ export default {
param.push(["检测时间", this.receiveCheckData.检测时间]);
param.push(["检测说明", this.receiveCheckData.检测说明]);
param.push(["放行数量", this.receiveCheckData.放行数量]);
param.push(["工位名称", this.receiveCheckData.工位名称]);
console.log(param);
try {

View File

@@ -965,6 +965,7 @@ export default {
return;
}
// 调用存储过程保存数据
this.receiveCheckVisible = false;
this.saveReceiveCheck();
});
},

View File

@@ -40,7 +40,7 @@
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
style="width: 150px; margin-right: 10px" />
<el-button :disabled="!!loading" icon="el-icon-search" plain type="primary" @click="searchTable()">查询</el-button>
<el-button :disabled="!!loading" icon="el-icon-search" plain type="primary" @click="handleSearch">查询</el-button>
<el-button style="width: 100px;" icon="el-icon-download" type="primary" @click="exportExcel">Excel导出</el-button>
</div>
@@ -165,10 +165,10 @@ export default {
param.push(["质检类型", this.QualityStatus]);
param.push(["开始日期", this.startDate]);
param.push(["结束日期", this.endDate]);
param.push(["订单号", this.orderNo ]);
param.push(["合同号", this.contractNo ]);
param.push(["零件编码", this.productCode ]);
param.push(["零件名称", this.productName ]);
param.push(["订单号", this.normalizeQueryValue(this.orderNo) ]);
param.push(["合同号", this.normalizeQueryValue(this.contractNo) ]);
param.push(["零件编码", this.normalizeQueryValue(this.productCode) ]);
param.push(["零件名称", this.normalizeQueryValue(this.productName) ]);
this.exporting = true
const Data = this.CreateData('2001', '质量管理_质检明细_导出', param)
@@ -218,6 +218,11 @@ export default {
// ============ 分页方法 ============
handleSearch() {
this.pageCurrent = 1
this.searchTable()
},
handleSizeChanges(val) {
this.pageCurrent = 1
this.pageSize = val
@@ -236,12 +241,12 @@ export default {
param.push(["质检类型", this.QualityStatus]);
param.push(["开始日期", this.startDate]);
param.push(["结束日期", this.endDate]);
param.push(["订单号", this.orderNo ]);
param.push(["合同号", this.contractNo ]);
param.push(["零件编码", this.productCode ]);
param.push(["零件名称", this.productName ]);
param.push(["订单号", this.normalizeQueryValue(this.orderNo) ]);
param.push(["合同号", this.normalizeQueryValue(this.contractNo) ]);
param.push(["零件编码", this.normalizeQueryValue(this.productCode) ]);
param.push(["零件名称", this.normalizeQueryValue(this.productName) ]);
param.push(['PageCurrent', this.pageCurrent])
param.push(['pageSize', this.pageSize])
param.push(['PageSize', this.pageSize])
param.push(['PageCount', '1111', 'int', '1'])
param.push(['ItemCount', '1111', 'int', '1'])
@@ -258,6 +263,10 @@ export default {
// ============ 工具方法 ============
normalizeQueryValue(value) {
return value === null || value === undefined || value === '' ? '0' : value
},
getCurrentUser() {
return this.$store.state.user.name
@@ -305,4 +314,4 @@ export default {
background-color: #f56c6c !important;
color: #000000 !important;
} */
</style>
</style>

View File

@@ -0,0 +1,247 @@
<template>
<div class="test-assembly-task">
<el-card>
<div class="search-container">
<span class="show-text">任务类型:</span>
<el-select
v-model="taskType"
placeholder="请选择任务类型"
style="width: 150px; margin-right: 10px"
@change="searchTable"
>
<el-option label="全部" value="全部" />
<el-option label="阀类" value="阀类" />
<el-option label="系统类" value="系统类" />
</el-select>
<span class="show-text">生产订单:</span>
<el-input
v-model="productionOrder"
placeholder="请输入生产订单"
clearable
style="width: 150px; margin-right: 10px"
@keyup.enter.native="searchTable"
/>
<span class="show-text">销售订单:</span>
<el-input
v-model="salesOrder"
placeholder="请输入销售订单"
clearable
style="width: 150px; margin-right: 10px"
@keyup.enter.native="searchTable"
/>
<span class="show-text">物料名称:</span>
<el-input
v-model="materialName"
placeholder="请输入物料名称"
clearable
style="width: 160px; margin-right: 10px"
@keyup.enter.native="searchTable"
/>
<span class="show-text">物料编码:</span>
<el-input
v-model="materialCode"
placeholder="请输入物料编码"
clearable
style="width: 180px; margin-right: 10px"
@keyup.enter.native="searchTable"
/>
<el-button :disabled="loading" icon="el-icon-search" plain type="primary" @click="searchTable">查询</el-button>
<el-button :disabled="loading" icon="el-icon-download" plain type="success" @click="exportToExcel">导出</el-button>
</div>
<el-table
v-loading="loading"
:data="tableData"
:height="'72vh'"
border
element-loading-background="rgba(0, 0, 0, 0.2)"
element-loading-spinner="el-icon-loading"
highlight-current-row
:row-class-name="tableRowClassName"
size="mini"
style="width: 100%; margin-top: 20px"
tooltip-effect="dark"
>
<el-table-column align="center" label="序号" type="index" width="60" fixed />
<el-table-column align="center" prop="预计送检日期" label="预计送检日期" width="120" fixed show-overflow-tooltip >
<template slot-scope="scope">
{{ formatDate(scope.row.预计送检日期) }}
</template>
</el-table-column>
<el-table-column align="center" prop="销售订单" label="销售订单" width="120" fixed show-overflow-tooltip />
<el-table-column align="center" prop="生产订单" label="生产订单" width="100" fixed />
<el-table-column align="center" prop="物料名称" label="物料名称" width="170" show-overflow-tooltip />
<el-table-column align="center" prop="物料编码" label="物料编码" width="180" show-overflow-tooltip />
<el-table-column align="center" prop="计划数量" label="计划数量" width="100" />
<el-table-column align="center" prop="完成数量" label="完成数量" width="100" />
<el-table-column align="center" prop="检验数量" label="检验数量" width="100" />
<el-table-column align="center" prop="检验合格数量" label="检验合格数量" width="120" />
<el-table-column align="center" prop="检验不合格数量" label="检验不合格数量" width="130" />
</el-table>
</el-card>
</div>
</template>
<script>
import * as XLSX from 'xlsx'
export default {
name: 'TestAssemblyTask',
data() {
return {
taskType: '全部',
productionOrder: '',
salesOrder: '',
materialName: '',
materialCode: '',
loading: false,
tableData: []
}
},
mounted() {
this.searchTable()
},
methods: {
formatDate(date) {
if (!date) return ''
return date.split(' ').length > 1 ? date.split(' ')[0] : date
},
tableRowClassName({ row }) {
return this.isInspectionUnfinished(row) ? 'inspection-unfinished-row' : ''
},
searchTable() {
this.loading = true
const param = []
param.push(['任务类型', this.taskType])
param.push(['生产订单', this.productionOrder])
param.push(['销售订单', this.salesOrder])
param.push(['物料名称', this.materialName])
param.push(['物料编码', this.materialCode])
const data = this.CreateData('11', '质量管理_测试装配任务_查询', param)
this.ExecDatabase(data).then(response => {
this.tableData = this.sortTableData(response.data || [])
}).catch(error => {
this.$message.error('查询失败:' + error.message)
}).finally(() => {
this.loading = false
})
},
exportToExcel() {
if (this.tableData.length === 0) {
this.$message.warning('没有数据可导出')
return
}
try {
const exportData = this.tableData.map((item, index) => ({
序号: index + 1,
预计送检日期: this.formatDate(item['预计送检日期']),
销售订单: item['销售订单'] || '',
生产订单: item['生产订单'] || '',
物料名称: item['物料名称'] || '',
物料编码: item['物料编码'] || '',
计划数量: item['计划数量'] || 0,
完成数量: item['完成数量'] || 0,
检验数量: item['检验数量'] || 0,
检验合格数量: item['检验合格数量'] || 0,
检验不合格数量: item['检验不合格数量'] || 0
}))
const wb = XLSX.utils.book_new()
const ws = XLSX.utils.json_to_sheet(exportData)
ws['!cols'] = [
{ wch: 8 },
{ wch: 15 },
{ wch: 15 },
{ wch: 15 },
{ wch: 24 },
{ wch: 20 },
{ wch: 12 },
{ wch: 12 },
{ wch: 12 },
{ wch: 16 },
{ wch: 18 }
]
XLSX.utils.book_append_sheet(wb, ws, '测试装配任务')
XLSX.writeFile(wb, `测试装配任务_${this.formatDateForFileName(new Date())}.xlsx`)
this.$message.success('导出成功')
} catch (error) {
console.error('导出失败:', error)
this.$message.error('导出失败')
}
},
sortTableData(data) {
return data.slice().sort((a, b) => {
const unfinishedA = this.isInspectionUnfinished(a)
const unfinishedB = this.isInspectionUnfinished(b)
if (unfinishedA !== unfinishedB) {
return unfinishedA ? -1 : 1
}
const timeA = this.getDateTime(a['预计送检日期'])
const timeB = this.getDateTime(b['预计送检日期'])
if (timeA === timeB) {
return 0
}
if (timeA === Infinity) {
return 1
}
if (timeB === Infinity) {
return -1
}
return timeA - timeB
})
},
isInspectionUnfinished(row) {
return this.getNumber(row['完成数量']) > this.getNumber(row['检验数量'])
},
getNumber(value) {
if (value === null || value === undefined || value === '') {
return 0
}
const number = Number(String(value).replace(/,/g, ''))
return Number.isNaN(number) ? 0 : number
},
getDateTime(value) {
if (!value) {
return Infinity
}
const time = new Date(String(value).replace(/-/g, '/')).getTime()
return Number.isNaN(time) ? Infinity : time
},
formatDateForFileName(date) {
const year = date.getFullYear()
const month = String(date.getMonth() + 1).padStart(2, '0')
const day = String(date.getDate()).padStart(2, '0')
const hours = String(date.getHours()).padStart(2, '0')
const minutes = String(date.getMinutes()).padStart(2, '0')
const seconds = String(date.getSeconds()).padStart(2, '0')
return `${year}${month}${day}_${hours}${minutes}${seconds}`
}
}
}
</script>
<style scoped>
.test-assembly-task {
padding: 10px;
}
.search-container {
display: flex;
align-items: center;
flex-wrap: wrap;
}
.show-text {
font-size: 14px;
margin-right: 6px;
}
::v-deep .inspection-unfinished-row > td {
background-color: #e6a23c !important;
color: #1f1f1f;
}
</style>

View File

@@ -52,6 +52,11 @@
<span type="success">{{ scope.row.roles_function }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="班组" prop="班组" show-overflow-tooltip>
<template slot-scope="scope">
<span type="success">{{ scope.row.班组 }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="操作" min-width="450">
<template slot-scope="scope">
<el-button icon="el-icon-refresh-right" style="font-family: MiSans Regular,serif;color: #4d77d6"
@@ -111,6 +116,27 @@
<el-form-item label="工号" prop="account">
<el-input v-model="form1.account" placeholder="请输入工号" readonly style="width: 240px;border-radius: 4px" />
</el-form-item>
<el-form-item label="班组" prop="班组">
<el-select
v-model="form1.team"
clearable
placeholder="请选择"
style="width: 150px; margin-right: 10px"
>
<el-option label="装配" value="装配" />
<el-option label="电气" value="电气" />
<el-option label="机加" value="机加" />
<el-option label="质检" value="质检" />
<el-option label="技术" value="技术" />
<el-option label="计划" value="计划" />
<el-option label="库房" value="库房" />
<el-option label="采购" value="采购" />
<el-option label="销售" value="销售" />
<el-option label="售后" value="售后" />
<el-option label="工艺" value="工艺" />
<el-option label="其他" value="其他" />
</el-select>
</el-form-item>
<!-- <el-form-item label="密码" prop="password">-->
<!-- <el-input-->
<!-- v-model="form1.password"-->
@@ -167,7 +193,8 @@ export default {
PersonalName: '',
account: '',
password: '',
PersonalroleValue: ''
PersonalroleValue: '',
team:''
},
rules1: {
PersonalName: [{ required: true, message: '请输入姓名', trigger: 'blur' }],
@@ -179,7 +206,8 @@ export default {
tableData: [],
total: 0, // 总条数
pageSize: 10, // 每页显示条数
pageList: 1 // 后台获取页
pageList: 1, // 后台获取页
team:''
}
},
created() {
@@ -251,7 +279,8 @@ export default {
password: response.data.result[i].password,
roles_number: parseInt(response.data.result[i].Roles_number),
roles_function: response.data.result[i].Roles_Function,
isClient: response.data.result[i].isClient
isClient: response.data.result[i].isClient,
班组:response.data.result[i].班组
})
}
}
@@ -270,6 +299,7 @@ export default {
this.form1.account = row.account
this.form1.password = row.password
this.form1.PersonalroleValue = row.roles_number
this.form1.team = row.班组
this.title1 = '编辑人员'
this.dialogFormVisible1 = true
},
@@ -284,6 +314,7 @@ export default {
param[2] = ['password', this.form1.password]
param[3] = ['Personnel_Name', this.form1.PersonalName]
param[4] = ['Roles_number', this.form1.PersonalroleValue]
param[5] = ['班组', this.form1.team]
if (this.form1.account === '' || this.form1.account === null) {
this.$message.error('请输入工号')
} else if (this.form1.password === '' || this.form1.password === null) {