|
|
@ -41,7 +41,7 @@ |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="3"> |
|
|
<el-col :span="3"> |
|
|
<el-form-item label="分切卷数"> |
|
|
<el-form-item label="分切卷数"> |
|
|
<el-input-number :controls="false" :step="0" v-model="pageData.rollCount" style="width: 60px;"></el-input-number> |
|
|
|
|
|
|
|
|
<el-input-number :controls="false" :step="0" v-model="pageData.rollCount" @change="handleRollCountChange" style="width: 60px;"></el-input-number> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
</el-row> |
|
|
</el-row> |
|
|
@ -135,6 +135,11 @@ |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column label="操作" align="center" width="110" class-name="operation-column"> |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
<el-button type="text" size="mini" @click="openRollDefectDialog(scope.$index)">不良原因</el-button> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
</el-table> |
|
|
</el-table> |
|
|
</div> |
|
|
</div> |
|
|
</el-form> |
|
|
</el-form> |
|
|
@ -146,6 +151,68 @@ |
|
|
</span> |
|
|
</span> |
|
|
</el-dialog> |
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 分卷不良原因对话框 --> |
|
|
|
|
|
<el-dialog |
|
|
|
|
|
title="不良原因" |
|
|
|
|
|
:close-on-click-modal="false" |
|
|
|
|
|
:visible.sync="rollDefectDialogVisible" |
|
|
|
|
|
width="700px" |
|
|
|
|
|
append-to-body> |
|
|
|
|
|
<div class="roll-defect-summary"> |
|
|
|
|
|
<span>当前卷:第{{ currentRollDefectIndex }}卷</span> |
|
|
|
|
|
<span>面损合计:{{ formatQty(getCurrentRollSurfaceLossQty()) }}</span> |
|
|
|
|
|
<span>已选不良合计:{{ formatQty(getCurrentRollDefectTotal()) }}</span> |
|
|
|
|
|
</div> |
|
|
|
|
|
<el-form :inline="true" label-position="top" class="roll-defect-form"> |
|
|
|
|
|
<el-form-item> |
|
|
|
|
|
<span slot="label" class="defect-code-label" @click="getBaseList(89)"><a>不良代码</a></span> |
|
|
|
|
|
<el-input |
|
|
|
|
|
v-model="rollDefectForm.defectCode" |
|
|
|
|
|
readonly |
|
|
|
|
|
class="defect-code-input" |
|
|
|
|
|
style="width: 130px" |
|
|
|
|
|
placeholder="请选择" |
|
|
|
|
|
@click.native="getBaseList(89)"> |
|
|
|
|
|
</el-input> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item label="不良数量"> |
|
|
|
|
|
<el-input-number |
|
|
|
|
|
v-model="rollDefectForm.defectQty" |
|
|
|
|
|
:controls="false" |
|
|
|
|
|
:min="0" |
|
|
|
|
|
style="width: 120px"> |
|
|
|
|
|
</el-input-number> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item label="不良描述"> |
|
|
|
|
|
<el-input |
|
|
|
|
|
v-model="rollDefectForm.defectDesc" |
|
|
|
|
|
readonly |
|
|
|
|
|
style="width: 250px"> |
|
|
|
|
|
</el-input> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item label=" "> |
|
|
|
|
|
<el-button type="primary" @click="addRollDefectItem">添加</el-button> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-form> |
|
|
|
|
|
<el-table |
|
|
|
|
|
:data="currentRollDefectList" |
|
|
|
|
|
border |
|
|
|
|
|
height="260" |
|
|
|
|
|
style="width: 100%;"> |
|
|
|
|
|
<el-table-column prop="defectCode" label="不良代码" width="120" align="center"></el-table-column> |
|
|
|
|
|
<el-table-column prop="defectDesc" label="不良描述" min-width="260" align="left"></el-table-column> |
|
|
|
|
|
<el-table-column prop="defectQty" label="不良数量" width="110" align="right"></el-table-column> |
|
|
|
|
|
<el-table-column label="操作" width="80" align="center"> |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
<el-button type="text" @click="removeRollDefectItem(scope.$index)">删除</el-button> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
</el-table> |
|
|
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
|
|
<el-button type="primary" @click="rollDefectDialogVisible = false">确定</el-button> |
|
|
|
|
|
</span> |
|
|
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
<!-- 固定载具选择对话框 --> |
|
|
<!-- 固定载具选择对话框 --> |
|
|
<el-dialog title="固定载具清单" :close-on-click-modal="false" v-drag :visible.sync="carrierModelFlag" width="950px"> |
|
|
<el-dialog title="固定载具清单" :close-on-click-modal="false" v-drag :visible.sync="carrierModelFlag" width="950px"> |
|
|
<div class="rq"> |
|
|
<div class="rq"> |
|
|
@ -311,6 +378,7 @@ |
|
|
<el-button @click="addCarrierFlag=false">关闭</el-button> |
|
|
<el-button @click="addCarrierFlag=false">关闭</el-button> |
|
|
</el-footer> |
|
|
</el-footer> |
|
|
</el-dialog> |
|
|
</el-dialog> |
|
|
|
|
|
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist> |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
@ -326,6 +394,7 @@ |
|
|
saveAbnormalRollData,/*保存异常截卷数据*/ |
|
|
saveAbnormalRollData,/*保存异常截卷数据*/ |
|
|
} from '@/api/yieldReport/com_separate_roll.js'; |
|
|
} from '@/api/yieldReport/com_separate_roll.js'; |
|
|
import { fixedCarrierSave } from '@/api/fixedCarrier/fixedCarrier.js'; |
|
|
import { fixedCarrierSave } from '@/api/fixedCarrier/fixedCarrier.js'; |
|
|
|
|
|
import Chooselist from '@/views/modules/common/Chooselist'; |
|
|
|
|
|
|
|
|
/*打印标签专用的js*/ |
|
|
/*打印标签专用的js*/ |
|
|
import { |
|
|
import { |
|
|
@ -344,7 +413,6 @@ |
|
|
removerLanguage, |
|
|
removerLanguage, |
|
|
saveSysLanguageList |
|
|
saveSysLanguageList |
|
|
} from "@/api/sysLanguage.js"; |
|
|
} from "@/api/sysLanguage.js"; |
|
|
|
|
|
|
|
|
import { |
|
|
import { |
|
|
getPartLabelTemplateList, |
|
|
getPartLabelTemplateList, |
|
|
callUspPartLabelTemplate |
|
|
callUspPartLabelTemplate |
|
|
@ -358,6 +426,9 @@ |
|
|
export default { |
|
|
export default { |
|
|
name: "com_separate_roll", |
|
|
name: "com_separate_roll", |
|
|
mixins: [labelPrintTemplates], |
|
|
mixins: [labelPrintTemplates], |
|
|
|
|
|
components: { |
|
|
|
|
|
Chooselist |
|
|
|
|
|
}, |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
titleCon: '创建分卷', |
|
|
titleCon: '创建分卷', |
|
|
@ -411,6 +482,17 @@ export default { |
|
|
carrierNo: '' |
|
|
carrierNo: '' |
|
|
}, |
|
|
}, |
|
|
rowDataList: [], // 排数据列表 |
|
|
rowDataList: [], // 排数据列表 |
|
|
|
|
|
// 分卷不良原因(前端暂存) |
|
|
|
|
|
rollDefectDialogVisible: false, |
|
|
|
|
|
currentRollDefectIndex: 1, |
|
|
|
|
|
tagNo: '', |
|
|
|
|
|
rollDefectForm: { |
|
|
|
|
|
defectCode: '', |
|
|
|
|
|
defectDesc: '', |
|
|
|
|
|
defectQty: null |
|
|
|
|
|
}, |
|
|
|
|
|
rollDefectMap: {}, |
|
|
|
|
|
currentRollDefectList: [], |
|
|
operatorData: { |
|
|
operatorData: { |
|
|
site: this.$store.state.user.site, |
|
|
site: this.$store.state.user.site, |
|
|
username: this.$store.state.user.name, |
|
|
username: this.$store.state.user.name, |
|
|
@ -603,6 +685,8 @@ export default { |
|
|
this.hasCachedData = false; |
|
|
this.hasCachedData = false; |
|
|
this.cachedDataCount = 0; |
|
|
this.cachedDataCount = 0; |
|
|
this.cachedRowDataList = []; // 重置缓存的原始行数据 |
|
|
this.cachedRowDataList = []; // 重置缓存的原始行数据 |
|
|
|
|
|
// 重置分卷不良原因暂存 |
|
|
|
|
|
this.resetRollDefectData(); |
|
|
// 清空行数据列表 |
|
|
// 清空行数据列表 |
|
|
this.rowDataList = []; |
|
|
this.rowDataList = []; |
|
|
//判断是否启用多语言 |
|
|
//判断是否启用多语言 |
|
|
@ -725,6 +809,22 @@ export default { |
|
|
this.pageData.rollCount = this.pageData.rowCount |
|
|
this.pageData.rollCount = this.pageData.rowCount |
|
|
} |
|
|
} |
|
|
this.initRowDataList() |
|
|
this.initRowDataList() |
|
|
|
|
|
this.resetRollDefectData() |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 卷数变化时校验并清理不良原因缓存 |
|
|
|
|
|
handleRollCountChange() { |
|
|
|
|
|
if (this.pageData.rollCount > this.pageData.rowCount) { |
|
|
|
|
|
this.pageData.rollCount = this.pageData.rowCount |
|
|
|
|
|
} |
|
|
|
|
|
const hasDefectReason = Object.keys(this.rollDefectMap).some(key => { |
|
|
|
|
|
const list = this.rollDefectMap[key] |
|
|
|
|
|
return Array.isArray(list) && list.length > 0 |
|
|
|
|
|
}) |
|
|
|
|
|
if (hasDefectReason) { |
|
|
|
|
|
this.$message.warning('卷数已变更,原不良原因已清空,请重新维护') |
|
|
|
|
|
} |
|
|
|
|
|
this.resetRollDefectData() |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// 数量变化时自动计算不良数、良率和总数 |
|
|
// 数量变化时自动计算不良数、良率和总数 |
|
|
@ -744,6 +844,206 @@ export default { |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
resetRollDefectData() { |
|
|
|
|
|
this.rollDefectDialogVisible = false |
|
|
|
|
|
this.currentRollDefectIndex = 1 |
|
|
|
|
|
this.rollDefectMap = {} |
|
|
|
|
|
this.currentRollDefectList = [] |
|
|
|
|
|
this.resetRollDefectForm() |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
resetRollDefectForm() { |
|
|
|
|
|
this.rollDefectForm = { |
|
|
|
|
|
defectCode: '', |
|
|
|
|
|
defectDesc: '', |
|
|
|
|
|
defectQty: null |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
normalizeRollDefectMap() { |
|
|
|
|
|
const maxRollCount = Number(this.pageData.rollCount || 0) |
|
|
|
|
|
Object.keys(this.rollDefectMap).forEach(key => { |
|
|
|
|
|
if (Number(key) > maxRollCount) { |
|
|
|
|
|
this.$delete(this.rollDefectMap, key) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
getRollSegments() { |
|
|
|
|
|
const totalRows = Array.isArray(this.rowDataList) ? this.rowDataList.length : 0 |
|
|
|
|
|
const rollCount = Number(this.pageData.rollCount || 0) |
|
|
|
|
|
if (totalRows <= 0 || rollCount <= 0) { |
|
|
|
|
|
return [] |
|
|
|
|
|
} |
|
|
|
|
|
const rowsPerRoll = Math.floor(totalRows / rollCount) |
|
|
|
|
|
const remainingRows = totalRows % rollCount |
|
|
|
|
|
const segments = [] |
|
|
|
|
|
let startRow = 0 |
|
|
|
|
|
for (let i = 0; i < rollCount; i++) { |
|
|
|
|
|
const currentRollRows = rowsPerRoll + (i < remainingRows ? 1 : 0) |
|
|
|
|
|
if (currentRollRows <= 0) { |
|
|
|
|
|
continue |
|
|
|
|
|
} |
|
|
|
|
|
segments.push({ |
|
|
|
|
|
rollIndex: i + 1, |
|
|
|
|
|
startRow: startRow, |
|
|
|
|
|
endRow: startRow + currentRollRows - 1, |
|
|
|
|
|
rowCount: currentRollRows |
|
|
|
|
|
}) |
|
|
|
|
|
startRow += currentRollRows |
|
|
|
|
|
} |
|
|
|
|
|
return segments |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
getRollSegmentByRowIndex(rowIndex) { |
|
|
|
|
|
const segments = this.getRollSegments() |
|
|
|
|
|
return segments.find(item => rowIndex >= item.startRow && rowIndex <= item.endRow) || null |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
getRollSegmentByRollIndex(rollIndex) { |
|
|
|
|
|
const segments = this.getRollSegments() |
|
|
|
|
|
return segments.find(item => item.rollIndex === rollIndex) || null |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
ensureRollDefectList(rollIndex) { |
|
|
|
|
|
const key = String(rollIndex) |
|
|
|
|
|
if (!Array.isArray(this.rollDefectMap[key])) { |
|
|
|
|
|
this.$set(this.rollDefectMap, key, []) |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
openRollDefectDialog(rowIndex) { |
|
|
|
|
|
const segment = this.getRollSegmentByRowIndex(rowIndex) |
|
|
|
|
|
if (!segment) { |
|
|
|
|
|
this.$message.warning('当前卷信息无效,请先确认排数和卷数') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
this.currentRollDefectIndex = segment.rollIndex |
|
|
|
|
|
this.ensureRollDefectList(segment.rollIndex) |
|
|
|
|
|
this.currentRollDefectList = this.rollDefectMap[String(segment.rollIndex)] |
|
|
|
|
|
this.resetRollDefectForm() |
|
|
|
|
|
this.rollDefectDialogVisible = true |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
getRollSurfaceLossQty(rollIndex) { |
|
|
|
|
|
const segment = this.getRollSegmentByRollIndex(rollIndex) |
|
|
|
|
|
if (!segment) { |
|
|
|
|
|
return 0 |
|
|
|
|
|
} |
|
|
|
|
|
let total = 0 |
|
|
|
|
|
for (let i = segment.startRow; i <= segment.endRow; i++) { |
|
|
|
|
|
const row = this.rowDataList[i] |
|
|
|
|
|
total += Number(row && row.surfaceLossQty ? row.surfaceLossQty : 0) |
|
|
|
|
|
} |
|
|
|
|
|
return total |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
getCurrentRollSurfaceLossQty() { |
|
|
|
|
|
return this.getRollSurfaceLossQty(this.currentRollDefectIndex) |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
getRollDefectTotal(rollIndex) { |
|
|
|
|
|
const list = this.rollDefectMap[String(rollIndex)] || [] |
|
|
|
|
|
return list.reduce((sum, item) => sum + Number(item && item.defectQty ? item.defectQty : 0), 0) |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
getCurrentRollDefectTotal() { |
|
|
|
|
|
return this.getRollDefectTotal(this.currentRollDefectIndex) |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
formatQty(value) { |
|
|
|
|
|
const num = Number(value || 0) |
|
|
|
|
|
return Number(num.toFixed(6)).toString() |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
async addRollDefectItem() { |
|
|
|
|
|
if (!this.currentRollDefectList) { |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
this.rollDefectForm.defectCode = (this.rollDefectForm.defectCode || '').trim().toUpperCase() |
|
|
|
|
|
if (!this.rollDefectForm.defectCode) { |
|
|
|
|
|
this.$message.error('请先选择不良代码') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
if (!this.rollDefectForm.defectDesc) { |
|
|
|
|
|
this.$message.error('请选择有效的不良代码') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
const defectQty = Number(this.rollDefectForm.defectQty) |
|
|
|
|
|
if (!defectQty || defectQty <= 0) { |
|
|
|
|
|
this.$message.error('不良数量必须大于0') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const existing = this.currentRollDefectList.find(item => item.defectCode === this.rollDefectForm.defectCode) |
|
|
|
|
|
if (existing) { |
|
|
|
|
|
existing.defectQty = Number(existing.defectQty || 0) + defectQty |
|
|
|
|
|
existing.defectDesc = this.rollDefectForm.defectDesc |
|
|
|
|
|
} else { |
|
|
|
|
|
this.currentRollDefectList.push({ |
|
|
|
|
|
defectCode: this.rollDefectForm.defectCode, |
|
|
|
|
|
defectDesc: this.rollDefectForm.defectDesc, |
|
|
|
|
|
defectQty: defectQty |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
this.resetRollDefectForm() |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
removeRollDefectItem(index) { |
|
|
|
|
|
if (!this.currentRollDefectList) { |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
this.currentRollDefectList.splice(index, 1) |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
getBaseData(val) { |
|
|
|
|
|
if (this.tagNo === 89) { |
|
|
|
|
|
this.rollDefectForm.defectCode = val.DefectCode || '' |
|
|
|
|
|
this.rollDefectForm.defectDesc = val.DefectDesc || '' |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
getBaseList(val) { |
|
|
|
|
|
this.tagNo = val |
|
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
|
let strVal = '' |
|
|
|
|
|
if (val === 89) { |
|
|
|
|
|
strVal = this.rollDefectForm.defectCode || '' |
|
|
|
|
|
} |
|
|
|
|
|
this.$refs.baseList.init(val, strVal) |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
getRollDefectDetails(rollIndex) { |
|
|
|
|
|
const list = this.rollDefectMap[String(rollIndex)] || [] |
|
|
|
|
|
return list |
|
|
|
|
|
.map(item => ({ |
|
|
|
|
|
defectCode: item.defectCode, |
|
|
|
|
|
defectDesc: item.defectDesc || '', |
|
|
|
|
|
defectQty: Number(item.defectQty || 0) |
|
|
|
|
|
})) |
|
|
|
|
|
.filter(item => item.defectCode && item.defectQty > 0) |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 校验每卷不良原因合计必须等于该卷面损合计 |
|
|
|
|
|
validateRollDefectQtyBySurfaceLoss() { |
|
|
|
|
|
const segments = this.getRollSegments() |
|
|
|
|
|
if (!segments.length) { |
|
|
|
|
|
return true |
|
|
|
|
|
} |
|
|
|
|
|
this.normalizeRollDefectMap() |
|
|
|
|
|
for (let i = 0; i < segments.length; i++) { |
|
|
|
|
|
const rollIndex = segments[i].rollIndex |
|
|
|
|
|
const surfaceLossQty = this.getRollSurfaceLossQty(rollIndex) |
|
|
|
|
|
const defectReasonQty = this.getRollDefectTotal(rollIndex) |
|
|
|
|
|
if (Math.abs(surfaceLossQty - defectReasonQty) > 0.000001) { |
|
|
|
|
|
this.$message.error(`第${rollIndex}卷不良原因数量合计(${this.formatQty(defectReasonQty)})必须等于该卷面损数合计(${this.formatQty(surfaceLossQty)})`) |
|
|
|
|
|
return false |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
return true |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
// 验证排数据 |
|
|
// 验证排数据 |
|
|
validateRowData() { |
|
|
validateRowData() { |
|
|
if (this.pageData.rowCount <= 0) { |
|
|
if (this.pageData.rowCount <= 0) { |
|
|
@ -784,13 +1084,26 @@ export default { |
|
|
return true |
|
|
return true |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
for (let i = 0; i < this.rowDataList.length; i++) { |
|
|
|
|
|
const row = this.rowDataList[i] |
|
|
|
|
|
const packingList = row && row.packingList !== undefined && row.packingList !== null |
|
|
|
|
|
? String(row.packingList).trim() |
|
|
|
|
|
: '' |
|
|
|
|
|
if (!packingList) { |
|
|
|
|
|
this.$message.error(`Packing List不能为空`) |
|
|
|
|
|
|
|
|
const segments = this.getRollSegments() |
|
|
|
|
|
if (!segments.length) { |
|
|
|
|
|
return true |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
for (let i = 0; i < segments.length; i++) { |
|
|
|
|
|
const segment = segments[i] |
|
|
|
|
|
let hasPackingList = false |
|
|
|
|
|
for (let rowIndex = segment.startRow; rowIndex <= segment.endRow; rowIndex++) { |
|
|
|
|
|
const row = this.rowDataList[rowIndex] |
|
|
|
|
|
const packingList = row && row.packingList !== undefined && row.packingList !== null |
|
|
|
|
|
? String(row.packingList).trim() |
|
|
|
|
|
: '' |
|
|
|
|
|
if (packingList) { |
|
|
|
|
|
hasPackingList = true |
|
|
|
|
|
break |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
if (!hasPackingList) { |
|
|
|
|
|
this.$message.error(`第${segment.rollIndex}卷的Packing List不能为空`) |
|
|
return false |
|
|
return false |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
@ -899,6 +1212,11 @@ export default { |
|
|
return false; |
|
|
return false; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 校验每卷不良原因数量是否等于该卷面损数量 |
|
|
|
|
|
if (!this.validateRollDefectQtyBySurfaceLoss()) { |
|
|
|
|
|
return false; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 确认框 |
|
|
// 确认框 |
|
|
try { |
|
|
try { |
|
|
await this.$confirm('确定执行异常截卷操作吗?该操作将执行产量报告。', '提示', { |
|
|
await this.$confirm('确定执行异常截卷操作吗?该操作将执行产量报告。', '提示', { |
|
|
@ -978,6 +1296,7 @@ export default { |
|
|
rollNums: 1, |
|
|
rollNums: 1, |
|
|
totalDefectQty: totalDefectQty, |
|
|
totalDefectQty: totalDefectQty, |
|
|
rollRows: rollRows, |
|
|
rollRows: rollRows, |
|
|
|
|
|
rollDefectDetails: this.getRollDefectDetails(rollIndex + 1), |
|
|
packingList: rollPackingList, |
|
|
packingList: rollPackingList, |
|
|
remark: rollRemark |
|
|
remark: rollRemark |
|
|
}; |
|
|
}; |
|
|
@ -1062,40 +1381,21 @@ export default { |
|
|
|
|
|
|
|
|
// 表格合并行方法(备注列根据卷数合并) |
|
|
// 表格合并行方法(备注列根据卷数合并) |
|
|
objectSpanMethod({ row, column, rowIndex, columnIndex }) { |
|
|
objectSpanMethod({ row, column, rowIndex, columnIndex }) { |
|
|
// 对备注和Packing List列进行按卷合并 |
|
|
|
|
|
if (column.label === '备注' || column.label === 'Packing List') { |
|
|
|
|
|
// 计算每卷的排数 |
|
|
|
|
|
const rowsPerRoll = Math.floor(this.pageData.rowCount / this.pageData.rollCount) |
|
|
|
|
|
const remainingRows = this.pageData.rowCount % this.pageData.rollCount |
|
|
|
|
|
|
|
|
|
|
|
// 计算当前行属于第几卷 |
|
|
|
|
|
let currentRollIndex = 0 |
|
|
|
|
|
let accumulatedRows = 0 |
|
|
|
|
|
|
|
|
|
|
|
for (let i = 0; i < this.pageData.rollCount; i++) { |
|
|
|
|
|
const currentRollRows = rowsPerRoll + (i < remainingRows ? 1 : 0) |
|
|
|
|
|
if (rowIndex < accumulatedRows + currentRollRows) { |
|
|
|
|
|
currentRollIndex = i |
|
|
|
|
|
break |
|
|
|
|
|
} |
|
|
|
|
|
accumulatedRows += currentRollRows |
|
|
|
|
|
|
|
|
// 对备注、Packing List和操作列进行按卷合并 |
|
|
|
|
|
if (column.label === '备注' || column.label === 'Packing List' || column.label === '操作') { |
|
|
|
|
|
const segment = this.getRollSegmentByRowIndex(rowIndex) |
|
|
|
|
|
if (!segment) { |
|
|
|
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 计算当前卷的排数 |
|
|
|
|
|
const currentRollRows = rowsPerRoll + (currentRollIndex < remainingRows ? 1 : 0) |
|
|
|
|
|
|
|
|
|
|
|
// 如果是当前卷的第一行,显示合并的单元格 |
|
|
|
|
|
if (rowIndex === accumulatedRows) { |
|
|
|
|
|
|
|
|
if (rowIndex === segment.startRow) { |
|
|
return { |
|
|
return { |
|
|
rowspan: currentRollRows, |
|
|
|
|
|
|
|
|
rowspan: segment.rowCount, |
|
|
colspan: 1 |
|
|
colspan: 1 |
|
|
} |
|
|
} |
|
|
} else { |
|
|
|
|
|
// 其他行不显示 |
|
|
|
|
|
return { |
|
|
|
|
|
rowspan: 0, |
|
|
|
|
|
colspan: 0 |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
return { |
|
|
|
|
|
rowspan: 0, |
|
|
|
|
|
colspan: 0 |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
@ -1105,26 +1405,11 @@ export default { |
|
|
if (this.pageData.rowCount <= 0 || this.pageData.rollCount <= 0) { |
|
|
if (this.pageData.rowCount <= 0 || this.pageData.rollCount <= 0) { |
|
|
return {} |
|
|
return {} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 计算每卷的排数 |
|
|
|
|
|
const rowsPerRoll = Math.floor(this.pageData.rowCount / this.pageData.rollCount) |
|
|
|
|
|
const remainingRows = this.pageData.rowCount % this.pageData.rollCount |
|
|
|
|
|
|
|
|
|
|
|
// 计算当前行属于第几卷 |
|
|
|
|
|
let currentRollIndex = 0 |
|
|
|
|
|
let accumulatedRows = 0 |
|
|
|
|
|
|
|
|
|
|
|
for (let i = 0; i < this.pageData.rollCount; i++) { |
|
|
|
|
|
const currentRollRows = rowsPerRoll + (i < remainingRows ? 1 : 0) |
|
|
|
|
|
if (rowIndex < accumulatedRows + currentRollRows) { |
|
|
|
|
|
currentRollIndex = i |
|
|
|
|
|
break |
|
|
|
|
|
} |
|
|
|
|
|
accumulatedRows += currentRollRows |
|
|
|
|
|
|
|
|
const segment = this.getRollSegmentByRowIndex(rowIndex) |
|
|
|
|
|
if (!segment) { |
|
|
|
|
|
return {} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 计算当前卷的排数 |
|
|
|
|
|
const currentRollRows = rowsPerRoll + (currentRollIndex < remainingRows ? 1 : 0) |
|
|
|
|
|
|
|
|
const currentRollRows = segment.rowCount |
|
|
|
|
|
|
|
|
// 每行高度约为32px |
|
|
// 每行高度约为32px |
|
|
const rowHeight = 32 |
|
|
const rowHeight = 32 |
|
|
@ -1432,6 +1717,12 @@ export default { |
|
|
return false |
|
|
return false |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 校验每卷不良原因数量是否等于该卷面损数量 |
|
|
|
|
|
if (!this.validateRollDefectQtyBySurfaceLoss()) { |
|
|
|
|
|
this.yieldReportLoading = false; |
|
|
|
|
|
return false |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
try { |
|
|
try { |
|
|
// 计算分卷 |
|
|
// 计算分卷 |
|
|
const rowsPerRoll = Math.floor(this.pageData.rowCount / this.pageData.rollCount) |
|
|
const rowsPerRoll = Math.floor(this.pageData.rowCount / this.pageData.rollCount) |
|
|
@ -1484,6 +1775,7 @@ export default { |
|
|
rollNums: 1, // 固定为1 |
|
|
rollNums: 1, // 固定为1 |
|
|
defectQty: totalDefectQty, // 该卷的不良总数 |
|
|
defectQty: totalDefectQty, // 该卷的不良总数 |
|
|
rollRows: rollRows, // 该卷包含的排数据 |
|
|
rollRows: rollRows, // 该卷包含的排数据 |
|
|
|
|
|
rollDefectDetails: this.getRollDefectDetails(rollIndex + 1), |
|
|
packingList: rollPackingList, // 该卷的Packing List |
|
|
packingList: rollPackingList, // 该卷的Packing List |
|
|
remark: rollRemark // 该卷的备注 |
|
|
remark: rollRemark // 该卷的备注 |
|
|
} |
|
|
} |
|
|
@ -1797,7 +2089,6 @@ export default { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/* 备注列单元格样式 - 使用绝对定位填满 */ |
|
|
/* 备注列单元格样式 - 使用绝对定位填满 */ |
|
|
.customer-dialog >>> .el-table td:last-child, |
|
|
|
|
|
.customer-dialog >>> .el-table td.remark-column, |
|
|
.customer-dialog >>> .el-table td.remark-column, |
|
|
.customer-dialog >>> .el-table td.packing-list-column { |
|
|
.customer-dialog >>> .el-table td.packing-list-column { |
|
|
padding: 0 !important; |
|
|
padding: 0 !important; |
|
|
@ -1805,7 +2096,6 @@ export default { |
|
|
overflow: hidden !important; |
|
|
overflow: hidden !important; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.customer-dialog /deep/ .el-table td:last-child, |
|
|
|
|
|
.customer-dialog /deep/ .el-table td.remark-column, |
|
|
.customer-dialog /deep/ .el-table td.remark-column, |
|
|
.customer-dialog /deep/ .el-table td.packing-list-column { |
|
|
.customer-dialog /deep/ .el-table td.packing-list-column { |
|
|
padding: 0 !important; |
|
|
padding: 0 !important; |
|
|
@ -1869,6 +2159,33 @@ export default { |
|
|
overflow-y: auto !important; |
|
|
overflow-y: auto !important; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* 分卷不良原因对话框 */ |
|
|
|
|
|
.roll-defect-summary { |
|
|
|
|
|
display: flex; |
|
|
|
|
|
justify-content: space-between; |
|
|
|
|
|
align-items: center; |
|
|
|
|
|
margin-bottom: 12px; |
|
|
|
|
|
padding: 8px 12px; |
|
|
|
|
|
background: #f5f7fa; |
|
|
|
|
|
border-radius: 4px; |
|
|
|
|
|
color: #606266; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.roll-defect-form /deep/ .el-form-item { |
|
|
|
|
|
margin-right: 12px; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.roll-defect-form .defect-code-label a { |
|
|
|
|
|
color: #409EFF; |
|
|
|
|
|
font-weight: 600; |
|
|
|
|
|
cursor: pointer; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.roll-defect-form /deep/ .defect-code-input .el-input__inner { |
|
|
|
|
|
color: #409EFF; |
|
|
|
|
|
font-weight: 600; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
</style> |
|
|
</style> |
|
|
|
|
|
|
|
|
<style lang="scss"> |
|
|
<style lang="scss"> |
|
|
@ -1886,7 +2203,6 @@ export default { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/* 备注列样式 - 只针对创建分卷对话框 */ |
|
|
/* 备注列样式 - 只针对创建分卷对话框 */ |
|
|
.customer-css .el-table td:last-child, |
|
|
|
|
|
.customer-css .el-table td.remark-column, |
|
|
.customer-css .el-table td.remark-column, |
|
|
.customer-css .el-table td.packing-list-column { |
|
|
.customer-css .el-table td.packing-list-column { |
|
|
padding: 0 !important; |
|
|
padding: 0 !important; |
|
|
|