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