金蝶工序计划
This commit is contained in:
parent
c23718c42a
commit
29566db751
@ -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="铆焊工段" />
|
||||
@ -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" />
|
||||
@ -504,7 +508,7 @@ export default {
|
||||
'王海芳', '宋娇娇'
|
||||
],
|
||||
'机二工段': [
|
||||
'柴旭璞', '谷丽博', '裴旭卓', '刘少杰', '常书芳', '田由甲', '曹兴丽', '李子轩',
|
||||
'柴旭璞', '谷丽博', '裴旭卓', '刘少杰', '常书芳', '田由甲', '曹兴丽', '李少轩',
|
||||
'张旭泽', '王子过', '李蒲', '杜晓龙', '刘命鑫', '张梧祎', '赵伟', '安松浩',
|
||||
'刘思雨', '肖泽润', '魏双全', '李兴酉', '王锦翔', '张利明', '李少聪', '李强',
|
||||
'崔金铎', '于亚乐', '鲁彦芹', '路静茹', '刘翠青', '杨冲冲', '李晓玉', '宋佳佳',
|
||||
@ -516,7 +520,7 @@ export default {
|
||||
'马明广', '周佳乐', '李晓亮', '董献召', '王春炜', '付佳兴', '柳晓龙', '张雨轩',
|
||||
'石泽明', '王晓凡', '郝亮', '耿利刚', '魏辰强', '李永文', '吴海庆', '范会雨',
|
||||
'贾会涛', '吴凯亮', '赵兰争', '董亚军', '王晓军', '代程翼', '魏佳蕊', '齐乐芳',
|
||||
'康坤兰', '赵锦泽', '游梦皓', '牛立革', '宋金娜', '赵科飞'
|
||||
'康坤兰', '赵锦泽', '游梦皓', '牛立革', '宋金娜', '赵科飞','李进江'
|
||||
],
|
||||
'电钳工段': [
|
||||
'乔克俭', '乔鑫磊', '贾江涛', '魏兴宁', '韩巍', '温玉博',
|
||||
@ -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