Browse Source

2025-10-11

报工创建分卷优化
master
fengyuan_yang 3 months ago
parent
commit
b8fc27a9f0
  1. 2
      src/assets/scss/index.scss
  2. 56
      src/assets/scss/rq.scss
  3. 8
      src/views/modules/yieldReport/com_produce_report_normal.vue
  4. 306
      src/views/modules/yieldReport/com_separate_roll.vue

2
src/assets/scss/index.scss

@ -2,3 +2,5 @@
@import "variables"; // 站点变量
@import "base";
@import "global";
@import "rq";

56
src/assets/scss/rq.scss

@ -0,0 +1,56 @@
/* el-form-item 对话框标题 start*/
.el-dialog__title{
font-size: 14px;
font-weight: bold;
}
/* el-form-item 对话框标题 end*/
/* el-form-item 控件标题 start*/
.el-form-item__label{
font-size: 12px;
}
.pad .el-form-item__label {
font-size: 18px;
}
.pad .el-input__inner{
font-size: 18px;
}
.pad .el-input--medium .el-input__inner {
height: 35px;
line-height: 21px;
}
.pad .el-button--medium {
font-size: 18px;
}
.pad .el-table .cell {
line-height: 25px;
font-size: 18px;
height: 25px;
}
.pad .el-select-dropdown__item{
font-size: 18px;
}
//.el-table .cell, .el-table th div, .el-table--border td:first-child .cell, .el-table--border th:first-child .cell {
// padding-left: 0px;
//}
.rq .el-table .cell {
line-height: 20px;
font-size: 12px;
height: 20px;
}
.sl-svg {
overflow: hidden;
float: right;
}
.rq .auto /deep/ .el-form-item__content{
height: auto;
line-height: 1.5;
}

8
src/views/modules/yieldReport/com_produce_report_normal.vue

@ -3126,7 +3126,9 @@ export default {
functionName: '',
currentRollFlag: false,
repairOrderFlag: '',
checkMultipleRoll: ''
checkMultipleRoll: '',
rowCount: '',
rollCount: ''
},
currentRollOps: {
site: this.$store.state.user.site,
@ -3926,6 +3928,8 @@ export default {
this.scheduleData.resourceDesc = data.row.resourceDesc;
this.scheduleData.preItemNo = data.row.preItemNo;
this.scheduleData.closedFlag = data.row.closedFlag;
this.scheduleData.rowCount = data.row.rowCount;
this.scheduleData.rollCount = data.row.rollCount;
});
},
//
@ -4081,6 +4085,8 @@ export default {
this.scheduleData.resourceDesc = data.row.resourceDesc;
this.scheduleData.preItemNo = data.row.preItemNo;
this.scheduleData.closedFlag = data.row.closedFlag;
this.scheduleData.rowCount = data.row.rowCount;
this.scheduleData.rollCount = data.row.rollCount;
//
this.titleCon = '机台工作台' + ' - ' + data.row.itemDesc + ' '
+ data.row.resourceDesc + ' (' + this.operatorData.operatorName + ')';

306
src/views/modules/yieldReport/com_separate_roll.vue

@ -1,12 +1,12 @@
<template>
<div class="customer-css">
<el-dialog :title="titleCon" v-drag v-bind="$attrs" v-on="$listeners"
width="270px" style="height: 680px;" class="customer-dialog">
<el-form :inline="true" label-position="top" style="height: 100px;"
width="750px" style="height: 680px;" class="customer-dialog">
<el-form :inline="true" label-position="top" style="height: auto;"
label-width="80px">
<!-- 时间 -->
<!-- 时间和固定载具 -->
<el-row style="margin-top: -10px;">
<el-col :span="8">
<el-col :span="6">
<el-form-item :label=labels.currentTime>
<el-date-picker style="width: 100px;"
v-model="pageData.reportDate"
@ -16,37 +16,77 @@
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8" style="margin-left: 20px; margin-top: 27px;">
<el-col :span="5" style="margin-left: 10px; margin-top: 27px;">
<el-form-item :label="''">
<el-form-item :label="''">
<el-time-picker style="width: 80px;"
v-model="pageData.reportTime"
format="HH:mm:ss"
value-format="HH:mm:ss"
placeholder="">
</el-time-picker>
</el-form-item>
<el-time-picker style="width: 80px;"
v-model="pageData.reportTime"
format="HH:mm:ss"
value-format="HH:mm:ss"
placeholder="">
</el-time-picker>
</el-form-item>
</el-col>
</el-row>
<!-- 半成品卷卷号 -->
<el-row>
<el-col :span="12" style="margin-top: -5px;">
<el-form-item :label=labels.rollQty>
<el-input ref="rollQty" v-model="pageData.rollQty" style="width: 120px;" ></el-input>
<el-col :span="5" style="margin-left: 10px;">
<el-form-item label="固定载具">
<el-input v-model="pageData.fixture" style="width: 100px;" placeholder="固定载具"></el-input>
</el-form-item>
</el-col>
<el-col :span="3" style="margin-left: 10px;">
<el-form-item label="排数">
<el-input-number :controls="false" :step="0" v-model="pageData.rowCount" @change="handleRowCountChange" style="width: 80px;"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="12" style="margin-top: -5px;">
<el-form-item :label=labels.rollNums>
<el-input v-model="pageData.rollNums" style="width: 120px;" ></el-input>
<el-col :span="3" style="margin-left: 10px;">
<el-form-item label="卷数">
<el-input-number :controls="false" :step="0" v-model="pageData.rollCount" style="width: 80px;"></el-input-number>
</el-form-item>
</el-col>
</el-row>
<!-- 排数据表格 -->
<div class="rq">
<el-table
:data="rowDataList"
border
style="width: 100%; margin-top: 10px;"
max-height="350">
<el-table-column prop="rowNumber" label="NO." width="60" align="center">
</el-table-column>
<el-table-column label="良品数" width="200" align="center">
<template slot-scope="scope">
<el-input-number
:controls="false" :step="0"
v-model="scope.row.goodQty"
@change="handleQtyChange(scope.row)"
style="width: 100%"
class="good-qty-input">
</el-input-number>
</template>
</el-table-column>
<el-table-column label="不良数" width="200" align="center">
<template slot-scope="scope">
<el-input-number
:controls="false" :step="0"
v-model="scope.row.defectQty"
@change="handleQtyChange(scope.row)"
style="width: 100%"
class="defect-qty-input">
</el-input-number>
</template>
</el-table-column>
<el-table-column label="总数" align="center">
<template slot-scope="scope">
<div class="total-display">
{{ scope.row.totalQty }}
</div>
</template>
</el-table-column>
</el-table>
</div>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="checkCreateSeparateRolllBun">{{ buttons.confirmButton }}</el-button>
<el-button type="primary" @click="closeDialog">{{ buttons.closeButton }}</el-button>
<!-- <el-button v-if="showDefault" @click="saveMultiLanguage()" type="primary">多语言设置</el-button>-->
<el-button type="primary" @click="checkCreateSeparateRolllBun">保存</el-button>
<el-button @click="closeDialog">{{ buttons.closeButton }}</el-button>
</span>
</el-dialog>
</div>
@ -120,8 +160,13 @@ export default {
reportTime: '',
operatorId: '',
rollQty: 0,
rollNums: 1
rollNums: 1,
//
fixture: '', //
rowCount: 0, //
rollCount: 0 //
},
rowDataList: [], //
operatorData: {
site: this.$store.state.user.site,
username: this.$store.state.user.name,
@ -265,15 +310,76 @@ export default {
//
this.pageData.rollQty = 0;
this.pageData.rollNums = 1;
//
this.pageData.fixture = '';
this.pageData.rowCount = scheduleData.rowCount;
this.pageData.rollCount = scheduleData.rollCount;
//
// this.getMultiLanguageList(); //
//
this.$nextTick(() => {
this.$refs.rollQty.focus();
this.$refs.rollQty && this.$refs.rollQty.focus();
});
this.titleCon = this.labels.componentTitle;//
//
this.initRowDataList();
},
// ===================== =====================
//
initRowDataList() {
this.rowDataList = []
for (let i = 0; i < this.pageData.rowCount; i++) {
this.rowDataList.push({
rowNumber: i,
goodQty: 0,
defectQty: 0,
totalQty: 0
})
}
},
//
handleRowCountChange() {
if (this.pageData.rollCount > this.pageData.rowCount) {
this.pageData.rollCount = this.pageData.rowCount
}
this.initRowDataList()
},
//
handleQtyChange(row) {
row.totalQty = (row.goodQty || 0) + (row.defectQty || 0)
},
//
validateRowData() {
if (this.pageData.rowCount <= 0) {
this.$message.warning('请输入有效的排数')
return false
}
if (this.pageData.rollCount <= 0) {
this.$message.warning('请输入有效的卷数')
return false
}
if (this.pageData.rollCount > this.pageData.rowCount) {
this.$message.warning('卷数不能大于排数')
return false
}
//
const hasData = this.rowDataList.some(row => (row.goodQty > 0 || row.defectQty > 0))
if (!hasData) {
this.$message.warning('请至少输入一行数据')
return false
}
return true
},
// ===================== =====================
/*关闭modal*/
closeDialog(){
//
@ -306,26 +412,26 @@ export default {
checkCreateSeparateRolllBun() {
//
if (this.pageData.operatorId == '' || this.pageData.operatorId == null) {
if (this.pageData.operatorId === '' || this.pageData.operatorId == null) {
this.$message.error(this.labels.pleaseSwitchOperator);
return false;
}
//
let rollQty = parseFloat(this.pageData.rollQty);
//
if (rollQty <= 0 || !Number.isInteger(rollQty)){
this.$message.error(this.labels.approvedQtyMustMoreTanZeroAndBeInteger);
return false;
}
// //
// let rollQty = parseFloat(this.pageData.rollQty);
// //
// if (rollQty <= 0 || !Number.isInteger(rollQty)){
// this.$message.error(this.labels.approvedQtyMustMoreTanZeroAndBeInteger);
// return false;
// }
//
let rollNums = parseFloat(this.pageData.rollNums);
//
if (rollNums <= 0 || !Number.isInteger(rollNums)){
this.$message.error(this.labels.rollQtyMustMoreTanZeroAndBeInteger);
return false;
}
// //
// let rollNums = parseFloat(this.pageData.rollNums);
// //
// if (rollNums <= 0 || !Number.isInteger(rollNums)){
// this.$message.error(this.labels.rollQtyMustMoreTanZeroAndBeInteger);
// return false;
// }
//
checkCreateSplitSfdcRoll(this.pageData)
.then(({data}) => {
@ -349,23 +455,86 @@ export default {
},
/*执行创建分卷的操作*/
createSeparateRolllOperation() {
//
createSplitSfdcRoll(this.pageData).then(({data}) => {
//
if (data.code == 500) {
this.$message.error(data.msg);
} else {
//
let printList = data.printList;
printSfdcLabel(printList);
//
setTimeout(() =>{
//
this.closeDialog();
}, 1000)
async createSeparateRolllOperation() {
//
if (!this.validateRowData()) {
return false
}
try {
//
const rowsPerRoll = Math.floor(this.pageData.rowCount / this.pageData.rollCount)
const remainingRows = this.pageData.rowCount % this.pageData.rollCount
let currentRowIndex = 0
const allPrintList = []
//
for (let rollIndex = 0; rollIndex < this.pageData.rollCount; rollIndex++) {
//
const currentRollRows = rowsPerRoll + (rollIndex < remainingRows ? 1 : 0)
//
let totalGoodQty = 0
let totalDefectQty = 0
const rollRows = []
for (let i = 0; i < currentRollRows; i++) {
const row = this.rowDataList[currentRowIndex + i]
totalGoodQty += row.goodQty || 0
totalDefectQty += row.defectQty || 0
rollRows.push({
rowNumber: row.rowNumber,
goodQty: row.goodQty || 0,
defectQty: row.defectQty || 0,
totalQty: row.totalQty || 0
})
}
// rollNums1
const requestData = {
...this.pageData,
rollQty: totalGoodQty, //
rollNums: 1, // 1
totalDefectQty: totalDefectQty, //
rollRows: rollRows //
}
//
const {data} = await createSplitSfdcRoll(requestData)
if (data.code === 500) {
throw new Error(data.msg)
}
//
if (data.printList && data.printList.length > 0) {
allPrintList.push(...data.printList)
}
//
this.$message.success(`${rollIndex + 1}/${this.pageData.rollCount}卷创建成功`)
currentRowIndex += currentRollRows
}
//
this.$message.success('创建分卷完成!')
//
if (allPrintList.length > 0) {
printSfdcLabel(allPrintList)
}
})
//
setTimeout(() =>{
//
this.closeDialog()
}, 1000)
} catch (error) {
this.$message.error('创建分卷失败: ' + error.message)
}
},
//
@ -427,4 +596,25 @@ export default {
padding: 0px !important;
}
/* 良品数输入框样式 - 绿色加粗 */
::v-deep .good-qty-input .el-input__inner {
font-weight: bold;
color: #67c23a !important;
font-size: 16px;
}
/* 不良数输入框样式 - 红色加粗 */
::v-deep .defect-qty-input .el-input__inner {
font-weight: bold;
color: #f56c6c !important;
font-size: 16px;
}
/* 总数显示样式 */
.total-display {
font-weight: bold;
color: #303133;
font-size: 14px;
}
</style>
Loading…
Cancel
Save