diff --git a/src/api/production/schedule.js b/src/api/production/schedule.js
index 583cadb..1aea3d3 100644
--- a/src/api/production/schedule.js
+++ b/src/api/production/schedule.js
@@ -22,3 +22,5 @@ export const toolStart=data => createAPI(`schedule/toolStart`, 'post', data);
export const toolIssuance=data => createAPI(`schedule/toolIssuance`, 'post', data);
export const toolReport=data => createAPI(`schedule/toolReport`, 'post', data);
+export const toolReportCheck=data => createAPI(`schedule/toolReportCheck`, 'post', data);
+export const toolUseDetail=data => createAPI(`schedule/toolUseDetail`, 'post', data);
diff --git a/src/views/modules/schedule/toolReport.vue b/src/views/modules/schedule/toolReport.vue
index 0daa20e..886249d 100644
--- a/src/views/modules/schedule/toolReport.vue
+++ b/src/views/modules/schedule/toolReport.vue
@@ -114,7 +114,7 @@
min-width="100"
label="操作">
-
+ 查看工具记录
+
+
+
-
+
+ label="工具实例编码">
+ label="领用人">
取消
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 保存
+ 关闭
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -326,6 +438,8 @@
toolStart,
toolIssuance,
toolReport,
+ toolReportCheck,
+ toolUseDetail,
} from '@/api/production/schedule.js'
import Chooselist from '@/views/modules/common/Chooselist'
export default {
@@ -359,6 +473,13 @@
orderNo:'',
userId:'',
},
+ reportModalFlag:false,
+ toolReportData:{
+ toolInstanceID:'',
+ toolId:'',
+ moQty:'',
+ finishQty:'',
+ },
scanSeqNo:'',
stopModalFlag:false,
continueModalFlag:false,
@@ -366,6 +487,8 @@
qty2:'',
site: '',
operatorType: 0,
+ toolList2:[],
+ toolUseDetailFlag:false,
// 导出 start
exportData: [],
exportDataStandard: {
@@ -541,6 +664,7 @@
this.saveHeaderData.partDescription = currentData.partSpec;
this.saveHeaderData.workCenterNo = currentData.sWorkCenterNo;
this.saveHeaderData.workCenterDesc = currentData.workCenterDesc;
+ this.saveHeaderData.orderNo =currentData.orderNo;
this.toolList1=data.rows;
this.setUp.reviewFlag=true;
this.toolReportFlag=true;
@@ -572,13 +696,6 @@
return false;
}
let currentData = data.row;
- // if(currentData.closedFlag=='Y'){
- // this.scanSeqNo=''
- // this.$alert("该派工单已关闭!",'错误', {
- // confirmButtonText: '确定'
- // })
- // return false;
- // }
this.saveHeaderData.site = currentData.site;
this.saveHeaderData.seqNo = currentData.seqNo;
this.saveHeaderData.itemNo = currentData.itemNo;
@@ -612,30 +729,32 @@
site:this.saveHeaderData.site,
orderNo:this.saveHeaderData.orderNo,
seqNo:this.saveHeaderData.seqNo,
- toolInstanceID:this.toolInstanceID,
+ toolInstanceId:this.toolInstanceID,
itemNo:this.saveHeaderData.itemNo,
- reportedBy:this.$store.state.user.name,
+ reportedby:this.$store.state.user.name,
}
toolIssuance(inData).then(({data}) => {
if (data && data.code === 0) {
- let inData={
+ let data2={
username:this.$store.state.user.name,
- seqNo:this.scanSeqNo,
+ seqNo:this.saveHeaderData.seqNo,
}
- toolStart(inData).then(({data}) => {
+ toolStart(data2).then(({data}) => {
if (data && data.code === 0) {
this.toolList1=data.rows;
}
})
+ this.toolInstanceID='';
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
+ this.$nextTick(() => { this.$refs.issuance.focus();})
}
})
} else {
- this.scanSeqNo='';
+ this.toolInstanceID='';
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
@@ -643,7 +762,110 @@
})
}).catch(() => {
})
- }
+ },
+ toolReportCheck(){
+ let inData={
+ site:this.saveHeaderData.site,
+ orderNo:this.saveHeaderData.orderNo,
+ seqNo:this.saveHeaderData.seqNo,
+ toolInstanceId:this.toolInstanceID,
+ itemNo:this.saveHeaderData.itemNo,
+ reportedby:this.$store.state.user.name,
+ }
+ toolReportCheck(inData).then(({data}) => {
+ if (data && data.code === 0) {
+ this.toolInstanceID='';
+ this.toolReportData={
+ toolInstanceID:data.row.toolInstanceId,
+ toolId:data.row.toolId,
+ moQty:data.row.moQty,
+ finishQty:'',
+ }
+ this.reportModalFlag=true;
+ this.$nextTick(() => { this.$refs.reportDo.focus();})
+ } else {
+ this.toolInstanceID='';
+ this.$alert(data.msg, '错误', {
+ confirmButtonText: '确定'
+ })
+ } })
+ },
+ saveToolReport(){
+ if(this.toolReportData.finishQty==null||this.toolReportData.finishQty==''){
+ this.$alert("请输入生产数量!",'错误', {
+ confirmButtonText: '确定'
+ })
+ return false;
+ }
+ if(this.toolReportData.finishQty<0){
+ this.$alert("生产数量不能小于0!",'错误', {
+ confirmButtonText: '确定'
+ })
+ return false;
+ }
+ this.$confirm(`确定报工?`, '提示', {
+ confirmButtonText: '确定',
+ cancelButtonText: '取消',
+ type: 'warning'
+ }).then(() => {
+ let inData={
+ site:this.saveHeaderData.site,
+ orderNo:this.saveHeaderData.orderNo,
+ seqNo:this.saveHeaderData.seqNo,
+ toolInstanceId:this.toolReportData.toolInstanceID,
+ itemNo:this.saveHeaderData.itemNo,
+ reportedby:this.$store.state.user.name,
+ moQty:this.toolReportData.moQty,
+ finishQty:this.toolReportData.finishQty,
+ }
+ toolReport(inData).then(({data}) => {
+ if (data && data.code === 0) {
+ let data2={
+ username:this.$store.state.user.name,
+ seqNo:this.saveHeaderData.seqNo,
+ }
+ toolStart(data2).then(({data}) => {
+ if (data && data.code === 0) {
+ this.toolList1=data.rows;
+ }
+ })
+ this.reportModalFlag=false;
+ this.toolInstanceID='';
+ this.$message({
+ message: '操作成功',
+ type: 'success',
+ duration: 1500,
+ onClose: () => {
+ }
+ })
+ this.$nextTick(() => { this.$refs.report.focus();})
+ } else {
+ this.$alert(data.msg, '错误', {
+ confirmButtonText: '确定'
+ })
+ }
+ })
+ }).catch(() => {
+ })
+ },
+ initUseModal(row){
+ let currentData = row;
+ this.saveHeaderData.site = currentData.site;
+ this.saveHeaderData.seqNo = currentData.seqNo;
+ this.saveHeaderData.itemNo = currentData.itemNo;
+ this.saveHeaderData.operationDesc = currentData.itemDesc;
+ this.saveHeaderData.partNo = currentData.partNo;
+ this.saveHeaderData.partDescription = currentData.partSpec;
+ this.saveHeaderData.workCenterNo = currentData.sWorkCenterNo;
+ this.saveHeaderData.workCenterDesc = currentData.workCenterDesc;
+ this.saveHeaderData.orderNo =currentData.orderNo;
+ this.toolUseDetailFlag=true;
+ toolUseDetail(this.saveHeaderData).then(({data}) => {
+ if (data && data.code === 0) {
+ this.toolList2=data.rows;
+ }
+ })
+ },
},
created () {