金蝶工序计划

This commit is contained in:
tzy 2026-04-20 15:36:20 +08:00
parent c23718c42a
commit 29566db751

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="76px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="76px">
<el-form-item label="生产令号" prop="hbytSclh"> <el-form-item label="生产令号" prop="hbytSclh">
<el-input <el-input
v-model="queryParams.hbytSclh" v-model="queryParams.hbytSclh"
@ -18,6 +18,7 @@
style="width: 215px" style="width: 215px"
@change="handleQuery" @change="handleQuery"
> >
<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="铆焊工段" />
@ -49,7 +50,7 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<!-- <el-row :gutter="10" class="mb8"> <!-- <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
@ -214,7 +215,7 @@
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination
@ -289,6 +290,9 @@
size="mini" size="mini"
clearable clearable
filterable filterable
multiple
collapse-tags
collapse-tags-tooltip
placeholder="搜索选择人员" placeholder="搜索选择人员"
@change="markOperatorDirty(scope.row)" @change="markOperatorDirty(scope.row)"
style="width: 100%" style="width: 100%"
@ -341,12 +345,12 @@
</el-table-column> </el-table-column>
<el-table-column label="计划开始" width="160"> <el-table-column label="计划开始" width="160">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ getProcessPlanStartTime(scope.row) || '-' }}</span> <span>{{ formatDateOnly(getProcessPlanStartTime(scope.row)) || '-' }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="计划完成" width="160"> <el-table-column label="计划完成" width="160">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ getProcessPlanFinishTime(scope.row) || '-' }}</span> <span>{{ formatDateOnly(getProcessPlanFinishTime(scope.row)) || '-' }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="控制码" prop="optCtrlCode" min-width="120" /> <el-table-column label="控制码" prop="optCtrlCode" min-width="120" />
@ -466,15 +470,15 @@ export default {
form: {}, form: {},
staticEquipmentData: { staticEquipmentData: {
'机一工段': [ '机一工段': [
'车铣复合', '双主轴走心机', '数车', '数控外圆磨', '线切割', '电火花', '车铣复合', '双主轴走心机', '数车', '数控外圆磨', '线切割', '电火花',
'立铣', '龙门铣', '摇臂钻', '普车', '锯床', '转序员' '立铣', '龙门铣', '摇臂钻', '普车', '锯床', '转序员'
], ],
'机二工段': [ '机二工段': [
'立加', '立加 1370', '立加 1177', '数插 5035', '平磨', '立磨', '钳修', '立加', '立加 1370', '立加 1177', '数插 5035', '平磨', '立磨', '钳修',
'攻丝', '数控龙门铣', '卧加3519', '龙门2013', '龙门3018', '龙门' '攻丝', '数控龙门铣', '卧加3519', '龙门2013', '龙门3018', '龙门'
], ],
'铆焊工段': [ '铆焊工段': [
'数控激光下料', '数控火焰下料', '数控切管下料', '铆工', '焊工', '数控激光下料', '数控火焰下料', '数控切管下料', '铆工', '焊工',
'激光焊工', '机器人焊接', '打磨', '抛丸', '校形' '激光焊工', '机器人焊接', '打磨', '抛丸', '校形'
], ],
'委外中心': [ '委外中心': [
@ -498,25 +502,25 @@ export default {
}, },
staticOperatorData: { staticOperatorData: {
'机一工段': [ '机一工段': [
'刘彩茹', '王玉', '王瑞康', '王立兴', '张泽旭', '何亚平', '董柯朝', '张晓峰', '刘彩茹', '王玉', '王瑞康', '王立兴', '张泽旭', '何亚平', '董柯朝', '张晓峰',
'李风存', '贾中恒', '丁世强', '吴崎', '孙小健', '池彦朋', '焦伟涛', '柴鑫豪', '李风存', '贾中恒', '丁世强', '吴崎', '孙小健', '池彦朋', '焦伟涛', '柴鑫豪',
'孙朋园', '仇建龙', '张召飞', '楚世光', '许会强', '王永旺', '王颜强', '秦孟青', '孙朋园', '仇建龙', '张召飞', '楚世光', '许会强', '王永旺', '王颜强', '秦孟青',
'王海芳', '宋娇娇' '王海芳', '宋娇娇'
], ],
'机二工段': [ '机二工段': [
'柴旭璞', '谷丽博', '裴旭卓', '刘少杰', '常书芳', '田由甲', '曹兴丽', '李子轩', '柴旭璞', '谷丽博', '裴旭卓', '刘少杰', '常书芳', '田由甲', '曹兴丽', '李少轩',
'张旭泽', '王子过', '李蒲', '杜晓龙', '刘命鑫', '张梧祎', '赵伟', '安松浩', '张旭泽', '王子过', '李蒲', '杜晓龙', '刘命鑫', '张梧祎', '赵伟', '安松浩',
'刘思雨', '肖泽润', '魏双全', '李兴酉', '王锦翔', '张利明', '李少聪', '李强', '刘思雨', '肖泽润', '魏双全', '李兴酉', '王锦翔', '张利明', '李少聪', '李强',
'崔金铎', '于亚乐', '鲁彦芹', '路静茹', '刘翠青', '杨冲冲', '李晓玉', '宋佳佳', '崔金铎', '于亚乐', '鲁彦芹', '路静茹', '刘翠青', '杨冲冲', '李晓玉', '宋佳佳',
'秦孝宇', '赵铭豪', '李凯峰', '高子娟', '常志涛', '宁若奇', '周建坤', '张泽远', '秦孝宇', '赵铭豪', '李凯峰', '高子娟', '常志涛', '宁若奇', '周建坤', '张泽远',
'王晨光', '张佳祺', '王浩义', '王龙', '陈阳', '崔炫宇', '尚宇清', '金国林', '王晨光', '张佳祺', '王浩义', '王龙', '陈阳', '崔炫宇', '尚宇清', '金国林',
'李子洋', '康玉朝' '李子洋', '康玉朝'
], ],
'铆焊工段': [ '铆焊工段': [
'马明广', '周佳乐', '李晓亮', '董献召', '王春炜', '付佳兴', '柳晓龙', '张雨轩', '马明广', '周佳乐', '李晓亮', '董献召', '王春炜', '付佳兴', '柳晓龙', '张雨轩',
'石泽明', '王晓凡', '郝亮', '耿利刚', '魏辰强', '李永文', '吴海庆', '范会雨', '石泽明', '王晓凡', '郝亮', '耿利刚', '魏辰强', '李永文', '吴海庆', '范会雨',
'贾会涛', '吴凯亮', '赵兰争', '董亚军', '王晓军', '代程翼', '魏佳蕊', '齐乐芳', '贾会涛', '吴凯亮', '赵兰争', '董亚军', '王晓军', '代程翼', '魏佳蕊', '齐乐芳',
'康坤兰', '赵锦泽', '游梦皓', '牛立革', '宋金娜', '赵科飞' '康坤兰', '赵锦泽', '游梦皓', '牛立革', '宋金娜', '赵科飞','李进江'
], ],
'电钳工段': [ '电钳工段': [
'乔克俭', '乔鑫磊', '贾江涛', '魏兴宁', '韩巍', '温玉博', '乔克俭', '乔鑫磊', '贾江涛', '魏兴宁', '韩巍', '温玉博',
@ -869,6 +873,21 @@ export default {
const ts = new Date(s.replace(/-/g, '/')).getTime(); const ts = new Date(s.replace(/-/g, '/')).getTime();
return Number.isFinite(ts) ? ts : null; return Number.isFinite(ts) ? ts : null;
}, },
formatDateOnly(val) {
if (val == null || val === '') return '';
if (typeof val === 'string') {
const m = val.match(/\d{4}-\d{2}-\d{2}/);
if (m) return m[0];
}
const ts = this.toTimestamp(val);
if (!ts) return '';
const d = new Date(ts);
const y = d.getFullYear();
const mm = String(d.getMonth() + 1).padStart(2, '0');
const dd = String(d.getDate()).padStart(2, '0');
return `${y}-${mm}-${dd}`;
},
getProcessPlanStartTime(process) { getProcessPlanStartTime(process) {
if (!process) return ''; if (!process) return '';
return process.operPlanStartTime || process.fOperPlanStartTime || process.seqPlanStartTime || process.fSeqPlanStartTime || ''; return process.operPlanStartTime || process.fOperPlanStartTime || process.seqPlanStartTime || process.fSeqPlanStartTime || '';
@ -967,7 +986,7 @@ export default {
const equipment = p && p.equipment != null ? String(p.equipment) : ''; const equipment = p && p.equipment != null ? String(p.equipment) : '';
return { return {
...p, ...p,
__operatorDraft: operator, __operatorDraft: this.parseOperatorDraft(operator),
__operatorDirty: false, __operatorDirty: false,
__equipmentDraft: equipment, __equipmentDraft: equipment,
__equipmentDirty: false, __equipmentDirty: false,
@ -1024,15 +1043,36 @@ export default {
}, },
markOperatorDirty(row) { markOperatorDirty(row) {
if (!row) return; if (!row) return;
const origin = row.operator != null ? String(row.operator) : ''; const origin = this.normalizeOperatorText(row.operator);
const draft = row.__operatorDraft != null ? String(row.__operatorDraft) : ''; const draft = this.normalizeOperatorText(this.formatOperatorDraft(row.__operatorDraft));
row.__operatorDirty = origin !== draft; row.__operatorDirty = origin !== draft;
}, },
resetOperatorDraft(row) { resetOperatorDraft(row) {
if (!row) return; if (!row) return;
row.__operatorDraft = row.operator != null ? String(row.operator) : ''; row.__operatorDraft = this.parseOperatorDraft(row.operator != null ? String(row.operator) : '');
row.__operatorDirty = false; row.__operatorDirty = false;
}, },
parseOperatorDraft(text) {
const raw = this.normalizeOperatorText(text);
if (!raw) return [];
return raw
.split(/[、,;\s]+/)
.map(s => (s || '').trim())
.filter(Boolean);
},
formatOperatorDraft(draft) {
if (Array.isArray(draft)) {
return draft.map(s => (s || '').trim()).filter(Boolean).join('、');
}
return draft != null ? String(draft).trim() : '';
},
normalizeOperatorText(text) {
return (text != null ? String(text) : '')
.trim()
.replace(/\s+/g, '')
.replace(/[、,;]+/g, '、')
.replace(/^、+|、+$/g, '');
},
markEquipmentDirty(row) { markEquipmentDirty(row) {
if (!row) return; if (!row) return;
const origin = row.equipment != null ? String(row.equipment) : ''; const origin = row.equipment != null ? String(row.equipment) : '';
@ -1065,7 +1105,7 @@ export default {
entityEntryId: p.entityEntryId ?? null, entityEntryId: p.entityEntryId ?? null,
operNo: p.operNo ?? null, operNo: p.operNo ?? null,
processName: p.processName ?? null, processName: p.processName ?? null,
operator: p.__operatorDraft != null ? String(p.__operatorDraft).trim() : '', operator: this.formatOperatorDraft(p.__operatorDraft),
equipment: p.__equipmentDraft != null ? String(p.__equipmentDraft).trim() : '' equipment: p.__equipmentDraft != null ? String(p.__equipmentDraft).trim() : ''
})) }))
}; };
@ -1077,8 +1117,8 @@ export default {
: (this.processDialogList || []).filter(p => p && (p.__operatorDirty || p.__equipmentDirty)); : (this.processDialogList || []).filter(p => p && (p.__operatorDirty || p.__equipmentDirty));
const realRows = rows.filter(r => { const realRows = rows.filter(r => {
const originOperator = r && r.operator != null ? String(r.operator) : ''; const originOperator = this.normalizeOperatorText(r && r.operator != null ? String(r.operator) : '');
const draftOperator = r && r.__operatorDraft != null ? String(r.__operatorDraft).trim() : ''; const draftOperator = this.normalizeOperatorText(this.formatOperatorDraft(r && r.__operatorDraft));
const originEquipment = r && r.equipment != null ? String(r.equipment) : ''; const originEquipment = r && r.equipment != null ? String(r.equipment) : '';
const draftEquipment = r && r.__equipmentDraft != null ? String(r.__equipmentDraft).trim() : ''; const draftEquipment = r && r.__equipmentDraft != null ? String(r.__equipmentDraft).trim() : '';
return originOperator !== draftOperator || originEquipment !== draftEquipment; return originOperator !== draftOperator || originEquipment !== draftEquipment;
@ -1095,11 +1135,11 @@ export default {
updateOperationPlanningMainOperators(payload) updateOperationPlanningMainOperators(payload)
.then(() => { .then(() => {
realRows.forEach(r => { realRows.forEach(r => {
const nextOperator = r.__operatorDraft != null ? String(r.__operatorDraft).trim() : ''; const nextOperator = this.formatOperatorDraft(r.__operatorDraft);
const nextEquipment = r.__equipmentDraft != null ? String(r.__equipmentDraft).trim() : ''; const nextEquipment = r.__equipmentDraft != null ? String(r.__equipmentDraft).trim() : '';
r.operator = nextOperator; r.operator = nextOperator;
r.equipment = nextEquipment; r.equipment = nextEquipment;
r.__operatorDraft = nextOperator; r.__operatorDraft = this.parseOperatorDraft(nextOperator);
r.__equipmentDraft = nextEquipment; r.__equipmentDraft = nextEquipment;
r.__operatorDirty = false; r.__operatorDirty = false;
r.__equipmentDirty = false; r.__equipmentDirty = false;