|
|
|
@ -1,20 +1,20 @@ |
|
|
|
<template> |
|
|
|
<div class="customer-css"> |
|
|
|
<el-dialog :title="titleCon" v-drag v-bind="$attrs" v-on="$listeners" |
|
|
|
width="900px" style="height: 415px;" class="customer-dialog"> |
|
|
|
<el-form :inline="true" label-position="top" style="height: 265px;" |
|
|
|
width="575px" style="height: 360px;" class="customer-dialog"> |
|
|
|
<el-form :inline="true" label-position="top" style="height: 200px;" |
|
|
|
label-width="80px"> |
|
|
|
<!-- 主材料 --> |
|
|
|
<el-form> |
|
|
|
<fieldset class="customer-fieldset" style=""> |
|
|
|
<el-table height="180" |
|
|
|
:cell-style="customerCellStyle" :cell-class-name="customerCellClassName" |
|
|
|
:data="sfdcMaterialList" |
|
|
|
:data="scheduleShiftList" |
|
|
|
border |
|
|
|
v-loading="dataListLoading" |
|
|
|
style="width: 100%; margin-top: -5px;"> |
|
|
|
@row-click="setCurrentShiftRow" |
|
|
|
@row-dblclick="updateScheduleAndShift" |
|
|
|
style="margin-top: 0px;"> |
|
|
|
<el-table-column |
|
|
|
|
|
|
|
v-for="(item,index) in columnMaterialArray" :key="index" |
|
|
|
v-for="(item,index) in columnShiftArray" :key="index" |
|
|
|
:sortable="item.columnSortable" |
|
|
|
:prop="item.columnProp" |
|
|
|
:header-align="item.headerAlign" |
|
|
|
@ -34,45 +34,26 @@ |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</el-form> |
|
|
|
</fieldset> |
|
|
|
</el-form> |
|
|
|
|
|
|
|
|
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
<el-button type="primary" @click="updateScheduleAndShift">确 定</el-button> |
|
|
|
<el-button type="primary" @click="closeDialog">关闭</el-button> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { |
|
|
|
getSfdcMaterialByRollNo, |
|
|
|
endTuningAndStartProduce, |
|
|
|
getScheduleShiftWithSelect, |
|
|
|
} from '@/api/yieldReport/com_select_shift.js'; |
|
|
|
export default { |
|
|
|
name: "com_select_shift", |
|
|
|
data() { |
|
|
|
return { |
|
|
|
titleCon: '', |
|
|
|
scheduleData: { |
|
|
|
site: this.$store.state.user.site, |
|
|
|
username: this.$store.state.user.name, |
|
|
|
seqNo: '', |
|
|
|
orderNo: '', |
|
|
|
itemNo: 0, |
|
|
|
partNo: '', |
|
|
|
workCenterDesc: '', |
|
|
|
resourceDesc: '', |
|
|
|
rollNo: '', |
|
|
|
partDesc: '', |
|
|
|
planStartTime: '', |
|
|
|
planFinishTime: '', |
|
|
|
qtyRequiredOriginal: 0, |
|
|
|
scheduledDate: '', |
|
|
|
shiftNo: '', |
|
|
|
preItemDesc: '', |
|
|
|
nextItemDesc: '', |
|
|
|
nextItemNo: 0, |
|
|
|
currentRollFlag: false |
|
|
|
}, |
|
|
|
titleCon: '班次选择', |
|
|
|
currentShiftRow: {}, |
|
|
|
pageData: { |
|
|
|
site: this.$store.state.user.site, |
|
|
|
username: this.$store.state.user.name, |
|
|
|
@ -82,23 +63,15 @@ export default { |
|
|
|
operatorId: '', |
|
|
|
reportDate: '', |
|
|
|
reportTime: '', |
|
|
|
}, |
|
|
|
operatorData: { |
|
|
|
site: this.$store.state.user.site, |
|
|
|
username: this.$store.state.user.name, |
|
|
|
operatorId: '', |
|
|
|
operatorName: '', |
|
|
|
status: '', |
|
|
|
seqNo: '', |
|
|
|
showFlag: false |
|
|
|
scheduledDate: '', |
|
|
|
}, |
|
|
|
scheduleShiftList: [], |
|
|
|
columnShiftArray: [ |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 5306, |
|
|
|
serialNumber: '5306MaterialScheduleDate', |
|
|
|
tableId: "5306Material", |
|
|
|
serialNumber: '5306ShiftScheduleDate', |
|
|
|
tableId: "5306Shift", |
|
|
|
tableName: "派工单材料", |
|
|
|
columnProp: "scheduleDate", |
|
|
|
headerAlign: "center", |
|
|
|
@ -114,14 +87,14 @@ export default { |
|
|
|
}, |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 5305, |
|
|
|
serialNumber: '5305MaterialReportedBy', |
|
|
|
tableId: "5305Material", |
|
|
|
functionId: 5306, |
|
|
|
serialNumber: '5306ShiftShiftNo', |
|
|
|
tableId: "5306Shift", |
|
|
|
tableName: "派工单材料", |
|
|
|
columnProp: "reportedBy", |
|
|
|
columnProp: "shiftNo", |
|
|
|
headerAlign: "center", |
|
|
|
align: "center", |
|
|
|
columnLabel: "报告人", |
|
|
|
columnLabel: "班次", |
|
|
|
columnWidth: 60, |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
@ -132,14 +105,14 @@ export default { |
|
|
|
}, |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 5305, |
|
|
|
serialNumber: '5305MaterialRmRollNo', |
|
|
|
tableId: "5305Material", |
|
|
|
functionId: 5306, |
|
|
|
serialNumber: '5306ShiftShiftDesc', |
|
|
|
tableId: "5306Shift", |
|
|
|
tableName: "派工单材料", |
|
|
|
columnProp: "rmRollNo", |
|
|
|
columnProp: "shiftDesc", |
|
|
|
headerAlign: "center", |
|
|
|
align: "center", |
|
|
|
columnLabel: "材料卷号", |
|
|
|
columnLabel: "班次描述", |
|
|
|
columnWidth: 100, |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
@ -150,14 +123,14 @@ export default { |
|
|
|
}, |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 5305, |
|
|
|
serialNumber: '5305MaterialPartNo', |
|
|
|
tableId: "5305Material", |
|
|
|
functionId: 5306, |
|
|
|
serialNumber: '5306ShiftStartTime', |
|
|
|
tableId: "5306Shift", |
|
|
|
tableName: "派工单材料", |
|
|
|
columnProp: "partNo", |
|
|
|
columnProp: "startTime", |
|
|
|
headerAlign: "center", |
|
|
|
align: "center", |
|
|
|
columnLabel: "零部件编码", |
|
|
|
columnLabel: "上班时间", |
|
|
|
columnWidth: 100, |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
@ -168,32 +141,14 @@ export default { |
|
|
|
}, |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 5305, |
|
|
|
serialNumber: '5305MaterialStartDate', |
|
|
|
tableId: "5305Material", |
|
|
|
functionId: 5306, |
|
|
|
serialNumber: '5306ShiftEndTime', |
|
|
|
tableId: "5306Shift", |
|
|
|
tableName: "派工单材料", |
|
|
|
columnProp: "startDate", |
|
|
|
columnProp: "endTime", |
|
|
|
headerAlign: "center", |
|
|
|
align: "center", |
|
|
|
columnLabel: "开始使用时间", |
|
|
|
columnWidth: 125, |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: false |
|
|
|
}, |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 5305, |
|
|
|
serialNumber: '5305MaterialTransQty', |
|
|
|
tableId: "5305Material", |
|
|
|
tableName: "派工单材料", |
|
|
|
columnProp: "transQty", |
|
|
|
headerAlign: "center", |
|
|
|
align: "right", |
|
|
|
columnLabel: "数量", |
|
|
|
columnLabel: "下班时间", |
|
|
|
columnWidth: 80, |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
@ -204,32 +159,14 @@ export default { |
|
|
|
}, |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 5305, |
|
|
|
serialNumber: '5305MaterialNetIssueQty', |
|
|
|
tableId: "5305Material", |
|
|
|
functionId: 5306, |
|
|
|
serialNumber: '5306ShiftNextDayFlag', |
|
|
|
tableId: "5306Shift", |
|
|
|
tableName: "派工单材料", |
|
|
|
columnProp: "netIssueQty", |
|
|
|
columnProp: "nextDayFlag", |
|
|
|
headerAlign: "center", |
|
|
|
align: "right", |
|
|
|
columnLabel: "本卷调机数量", |
|
|
|
columnWidth: 100, |
|
|
|
columnHidden: true, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: false |
|
|
|
}, |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 5305, |
|
|
|
serialNumber: '5305MaterialKeyRMFlag', |
|
|
|
tableId: "5305Material", |
|
|
|
tableName: "派工单材料", |
|
|
|
columnProp: "keyRMFlag", |
|
|
|
headerAlign: "center", |
|
|
|
align: "center", |
|
|
|
columnLabel: "是否主材", |
|
|
|
columnLabel: "次日", |
|
|
|
columnWidth: 80, |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
@ -237,24 +174,6 @@ export default { |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: false |
|
|
|
}, |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 5305, |
|
|
|
serialNumber: '5305MaterialSAPBOMItemNo', |
|
|
|
tableId: "5305Material", |
|
|
|
tableName: "派工单材料", |
|
|
|
columnProp: "sAPBOMItemNo", |
|
|
|
headerAlign: "center", |
|
|
|
align: "center", |
|
|
|
columnLabel: "SAP BOM序号", |
|
|
|
columnWidth: 100, |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: false |
|
|
|
} |
|
|
|
], |
|
|
|
dataListLoading: false, |
|
|
|
@ -262,20 +181,9 @@ export default { |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
/*初始化页面参数*/ |
|
|
|
init(pageData, operatorData) { |
|
|
|
init(pageData) { |
|
|
|
//设置参数 |
|
|
|
this.pageData.orderNo = pageData.orderNo; |
|
|
|
this.pageData.itemNo = pageData.itemNo; |
|
|
|
this.pageData.seqNo = pageData.seqNo; |
|
|
|
this.pageData.rollNo = pageData.rollNo; |
|
|
|
this.pageData.operatorId = operatorData.operatorId; |
|
|
|
//重置时间 |
|
|
|
this.pageData.reportDate = this.dayjs(new Date()).format('YYYY-MM-DD'); |
|
|
|
this.pageData.reportTime = this.dayjs(new Date()).format('HH:mm:ss'); |
|
|
|
//初始化操作员对象 |
|
|
|
this.operatorData = JSON.parse(JSON.stringify(operatorData)); |
|
|
|
//初始化标题 |
|
|
|
this.titleCon = '卷调机-卷材料结算'; |
|
|
|
this.pageData = JSON.parse(JSON.stringify(pageData)); |
|
|
|
//刷新当前派工单的信息 |
|
|
|
this.refreshPageData(); |
|
|
|
}, |
|
|
|
@ -287,67 +195,31 @@ export default { |
|
|
|
|
|
|
|
/*刷新当前的页面参数*/ |
|
|
|
refreshPageData(){ |
|
|
|
//刷新材料的数据 |
|
|
|
this.refreshSfdcMaterialTable(); |
|
|
|
}, |
|
|
|
|
|
|
|
//刷新当前卷的时间数据 |
|
|
|
refreshSfdcMaterialTable(){ |
|
|
|
getSfdcMaterialByRollNo(this.pageData).then(({data}) => { |
|
|
|
this.sfdcMaterialList = data.rows; |
|
|
|
}); |
|
|
|
//刷新班次的数据 |
|
|
|
this.refreshScheduleShiftTable(); |
|
|
|
}, |
|
|
|
|
|
|
|
//结束调机和开始生产 |
|
|
|
endTuningAndStartProduceOperation(){ |
|
|
|
let requestData = {'pageData': JSON.stringify(this.pageData), 'materialList': JSON.stringify(this.sfdcMaterialList)}; |
|
|
|
endTuningAndStartProduce(requestData).then(({data}) => { |
|
|
|
//判断操作是否成功 |
|
|
|
if(data.code == 500){ |
|
|
|
this.$message.error(data.msg); |
|
|
|
}else{ |
|
|
|
//关闭上机dialog的页面 |
|
|
|
this.$emit('closeDialog'); |
|
|
|
//关闭当前的页面 |
|
|
|
this.closeDialog(); |
|
|
|
} |
|
|
|
//刷新数据 |
|
|
|
refreshScheduleShiftTable(){ |
|
|
|
getScheduleShiftWithSelect(this.pageData).then(({data}) => { |
|
|
|
this.scheduleShiftList = data.rows; |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
/*检查数据是否有效*/ |
|
|
|
checkValidQty(row){ |
|
|
|
//判断当前是否为空 |
|
|
|
if(row.netIssueQty == ''){ |
|
|
|
this.$message.error('材料上本卷耗用数量不能为空!'); |
|
|
|
row.netIssueQty = 0;//重新赋值 |
|
|
|
return false; |
|
|
|
} |
|
|
|
//判断当前是否有效 |
|
|
|
if(row.netIssueQty <= 0){ |
|
|
|
this.$message.error('材料上本卷耗用数量必须大于0!'); |
|
|
|
return false; |
|
|
|
} |
|
|
|
//判断是否超限 |
|
|
|
if(row.netIssueQty > row.transQty){ |
|
|
|
this.$message.error('材料上本卷耗用数量大于发料数量!'); |
|
|
|
row.netIssueQty = 0;//重新赋值 |
|
|
|
return false; |
|
|
|
} |
|
|
|
/*设置当前选择的班次信息*/ |
|
|
|
setCurrentShiftRow(row, column, event){ |
|
|
|
this.currentShiftRow = JSON.parse(JSON.stringify(row)); |
|
|
|
}, |
|
|
|
|
|
|
|
/*添加定制的css类*/ |
|
|
|
customerCellClassName({row, column, rowIndex, columnIndex}) { |
|
|
|
if(column.property == 'netIssueQty'){ |
|
|
|
return 'customer-number-cell'; |
|
|
|
} |
|
|
|
//初始化班次的和时间 |
|
|
|
updateScheduleAndShift(){ |
|
|
|
//调用回调的方法 |
|
|
|
this.$emit("initScheduleShift", this.currentShiftRow.scheduleDate, |
|
|
|
this.currentShiftRow.shiftNo, this.pageData.username); |
|
|
|
//关闭当前的弹窗 |
|
|
|
this.closeDialog(); |
|
|
|
}, |
|
|
|
|
|
|
|
/*添加定制的cess样式*/ |
|
|
|
customerCellStyle({row, column, rowIndex, columnIndex}) { |
|
|
|
if(column.property == 'netIssueQty'){ |
|
|
|
return 'padding: 0px 0px;'; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
created() { |
|
|
|
|