ruanqi 2 years ago
parent
commit
8e6b3692a6
  1. 3
      src/api/production/schedule.js
  2. 391
      src/views/modules/schedule/toolReport.vue

3
src/api/production/schedule.js

@ -17,5 +17,8 @@ export const getSfdcList=data => createAPI(`schedule/getSfdcList`, 'post', data)
export const cancelSfdc=data => createAPI(`schedule/cancelSfdc`, 'post', data);
export const getStockPrint=data => createAPI(`schedule/getStockPrint`, 'post', data);
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);

391
src/views/modules/schedule/toolReport.vue

@ -114,7 +114,7 @@
min-width="100"
label="操作">
<template slot-scope="scope" class="foo_container">
<a type="text" size="small" @click="initReportModal(scope.row)">报工</a>
<!-- <a type="text" size="small" @click="initReportModal(scope.row)">报工</a>-->
</template>
</el-table-column>
<el-table-column
@ -252,113 +252,67 @@
<el-button type="primary" @click="startModalFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
<el-dialog @close="closeDialog" :close-on-click-modal="false" :close-on-press-escape="false" v-drag title="报告信息" :visible.sync="setUp.reviewFlag" width="615px">
<el-dialog :close-on-click-modal="false" :close-on-press-escape="false" v-drag :title="pageTitle" :visible.sync="setUp.reviewFlag" width="615px">
<el-form :inline="true" label-position="top">
<el-form-item label="派工单号">
<el-input style="width: 130px;" :disabled="setUp.disabled" onkeyup="this.value = this.value.toUpperCase()" v-model="saveHeaderData.seqNo"></el-input>
<el-input style="width: 130px;" readonly onkeyup="this.value = this.value.toUpperCase()" v-model="saveHeaderData.seqNo"></el-input>
</el-form-item>
<el-form-item label="产品编码">
<el-input style="width: 130px;" :disabled="setUp.disabled" v-model="saveHeaderData.partNo"></el-input>
<el-input style="width: 130px;" readonly v-model="saveHeaderData.partNo"></el-input>
</el-form-item>
<el-form-item label="产品名称/规格型号">
<el-input style="width: 275px;" :disabled="setUp.disabled" v-model="saveHeaderData.partDescription"></el-input>
<el-input style="width: 275px;" readonly v-model="saveHeaderData.partDescription"></el-input>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top">
<el-form-item label="工序号">
<el-input style="width: 130px;" :disabled="setUp.disabled" v-model="saveHeaderData.itemNo"></el-input>
<el-input style="width: 130px;" readonly v-model="saveHeaderData.itemNo"></el-input>
</el-form-item>
<el-form-item label="工序名称">
<el-input style="width: 130px;" :disabled="setUp.disabled" v-model="saveHeaderData.operationDesc"></el-input>
<el-input style="width: 130px;" readonly v-model="saveHeaderData.operationDesc"></el-input>
</el-form-item>
<el-form-item label="加工中心编码">
<el-input style="width: 130px;" :disabled="setUp.disabled" v-model="saveHeaderData.workCenterNo"></el-input>
<el-input style="width: 130px;" readonly v-model="saveHeaderData.workCenterNo"></el-input>
</el-form-item>
<el-form-item label="加工中心名称">
<el-input style="width: 130px;" :disabled="setUp.disabled" v-model="saveHeaderData.workCenterDesc"></el-input>
<el-input style="width: 130px;" readonly v-model="saveHeaderData.workCenterDesc"></el-input>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top">
<el-form-item>
<span slot="label" style="" @click="getBaseList(26 ,1)"><a herf="#">操作员</a></span>
<el-input style="width: 130px;" v-model="saveHeaderData.operatorId"></el-input>
</el-form-item>
<el-form-item label="操作员姓名">
<el-input style="width: 130px;" v-model="saveHeaderData.operatorName"></el-input>
</el-form-item>
<el-form-item label="生产日期">
<el-date-picker
style="width: 130px"
v-model="saveHeaderData.planStartTime"
type="date"
value-format="yyyy-MM-dd"
format = "yyyy-MM-dd"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
<el-form-item label="报告日期">
<el-date-picker
style="width: 130px"
v-model="saveHeaderData.planFinishTime"
type="date"
value-format="yyyy-MM-dd"
format = "yyyy-MM-dd"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top">
<el-form-item label="本工序报工数">
<el-input style="width: 130px;" :disabled="setUp.disabled" v-model="qty1"></el-input>
</el-form-item>
<el-form-item label="上工序报工数">
<el-input style="width: 130px;" :disabled="setUp.disabled" v-model="qty2"></el-input>
</el-form-item>
<el-form-item label="本派工单数量">
<el-input style="width: 130px;" disabled v-model="saveHeaderData.qtyRequire"></el-input>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top">
<el-form-item label="合格数量">
<el-input type="number" style="width: 178px;" class="input_reight" v-model="saveHeaderData.qtyApprove" ></el-input>
</el-form-item>
<el-form-item label="不合格数量" >
<el-input type="number" class="input_left" style="width: 178px;" v-model="saveHeaderData.qtyUnApprove" ></el-input>
</el-form-item>
</el-form>
<fieldset class="customer-fieldset" style="width: 597px;margin-left: -10px;">
<legend class="customer-legend">不良品分析</legend>
<el-form :inline="true" label-position="top">
<el-form-item>
<span slot="label" style="" @click="getBaseList(26 ,2)"><a herf="#">操作员</a></span>
<el-input style="width: 178px;" v-model="saveHeaderData.operatorId2"></el-input>
</el-form-item>
<el-form-item label="操作员姓名">
<el-input style="width: 178px;" v-model="saveHeaderData.operatorIdName2"></el-input>
</el-form-item>
<el-form-item label="报废原因">
<el-input style="width: 178px;" v-model="saveHeaderData.scrapReason"></el-input>
</el-form-item>
</el-form>
</fieldset>
<el-form :inline="true" label-position="top">
<el-form-item label="准备时间">
<el-input type="number" style="width: 178px;text-align: right;" v-model="saveHeaderData.preparationTime" ></el-input> <!--oninput ="value=value.replace(/[^0-9.]/g,'')"-->
<!-- <el-input-number style="width: 178px;text-align: right;" v-model="saveHeaderData.preparationTime" size="medium" :min="0" :controls="false"></el-input-number>-->
</el-form-item>
<el-form-item label="制造时间">
<el-input type="number" style="width: 178px;" v-model="saveHeaderData.manufacturingTime"></el-input> <!--oninput ="value=value.replace(/[^0-9.]/g,'')"-->
<!-- <el-input-number style="width: 178px;text-align: right;" v-model="saveHeaderData.manufacturingTime" size="medium" :min="0" :controls="false"></el-input-number>-->
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top">
<el-form-item label="备注">
<el-input style="width: 560px;" v-model="saveHeaderData.remark"></el-input>
<el-form-item label="请扫描工具条码">
<el-input v-if="!toolReportFlag" style="width: 130px;" ref="issuance" v-model="toolInstanceID" @keyup.enter.native="toolIssuance()"></el-input>
<el-input v-if="toolReportFlag" style="width: 130px;" ref="report" v-model="toolInstanceID" @keyup.enter.native="toolReport()"></el-input>
</el-form-item>
</el-form>
<el-table
height="200"
:data="toolList1"
border
style="width: 100%">
<el-table-column
prop="toolInstanceID"
header-align="center"
align="left"
min-width="100"
label="工具编码">
</el-table-column>
<el-table-column
prop="toolDesc"
header-align="center"
align="left"
min-width="100"
label="工具名称">
</el-table-column>
<el-table-column
prop="StartDate"
header-align="center"
align="left"
min-width="100"
label="领用日期">
</el-table-column>
</el-table>
<span slot="footer" class="dialog-footer">
<el-button @click="setUp.reviewFlag = false">取消</el-button>
<el-button type="primary" :disabled="setUp.saveButton" @click="saveReport()">确定</el-button>
</span>
</el-dialog>
@ -368,11 +322,10 @@
<script>
import {
getSOScheduleRoutingData
, saveGenerateReportForSchedule,
searchReportedQty,
searchSeqNo,
startSeqNo,
getSOScheduleRoutingData,
toolStart,
toolIssuance,
toolReport,
} from '@/api/production/schedule.js'
import Chooselist from '@/views/modules/common/Chooselist'
export default {
@ -389,11 +342,12 @@
readonlyFlag: false,
disabled: false
},
toolReportFlag:'',
toolInstanceID:'',
toolList1:[],
factorFlag:false,
abnormalList:[],
saveHeaderData: {
qtyRequire:'',
qtyUnApprove:'',
site: '',
seqNo: '',
itemNo: '',
@ -402,23 +356,7 @@
operationDesc: '',
workCenterNo: '',
workCenterDesc: '',
operatorId: '',
operatorName: '',
planStartTime: '',
planFinishTime: '',
qtyReported: 0,
qtyApprove: 0,
qtyRework: 0,
operatorId2: '',
operatorIdName2: '',
scrapReason: '',
preparationTime: 0,
manufacturingTime: 0,
cleaningTime: 0,
shutdownReason: '',
remark: '',
orderRef1:'',
scheduleType:'',
orderNo:'',
userId:'',
},
scanSeqNo:'',
@ -476,6 +414,7 @@
currentData:'',
tagNo2:'',
startModalFlag:false,
pageTitle:'',
}
},
@ -486,70 +425,6 @@
},
methods: {
saveReport () {
this.saveHeaderData.qtyReported=Number(this.saveHeaderData.qtyUnApprove)+Number(this.saveHeaderData.qtyApprove);
if (this.saveHeaderData.qtyUnApprove == null || this.saveHeaderData.qtyUnApprove < 0) {
this.$alert('不合格数量错误!', '错误信息', {
confirmButtonText: '确定'
})
return
}
if (this.saveHeaderData.qtyApprove == null || this.saveHeaderData.qtyApprove < 0) {
this.$alert('合格数量错误!', '错误信息', {
confirmButtonText: '确定'
})
return
}
if (this.saveHeaderData.qtyRework == null || this.saveHeaderData.qtyRework <0) {
this.$alert('返工数量错误!', '错误信息', {
confirmButtonText: '确定'
})
return
}
if (this.saveHeaderData.preparationTime == null || this.saveHeaderData.preparationTime < 0) {
this.$alert('准备时间错误!', '错误信息', {
confirmButtonText: '确定'
})
return
}
if (this.saveHeaderData.manufacturingTime == '' || this.saveHeaderData.manufacturingTime == null || this.saveHeaderData.manufacturingTime < 0) {
this.$alert('制造时间错误!', '错误信息', {
confirmButtonText: '确定'
})
return
}
if (this.saveHeaderData.cleaningTime == null || this.saveHeaderData.cleaningTime < 0) {
this.$alert('清理时间错误!', '错误信息', {
confirmButtonText: '确定'
})
return
}
if (this.saveHeaderData.planStartTime == null || this.saveHeaderData.planStartTime === '') {
this.$alert('请选择生产日期!', '错误信息', {
confirmButtonText: '确定'
})
return
}
if (this.saveHeaderData.planFinishTime == null || this.saveHeaderData.planFinishTime === '') {
this.$alert('请选择报告日期!', '错误信息', {
confirmButtonText: '确定'
})
return
}
this.setUp.saveButton=true;
saveGenerateReportForSchedule(this.saveHeaderData).then(({data}) => {
if (data.code == 0) {
this.$message.success(data.msg)
this.setUp.reviewFlag = false
this.search()
} else {
this.setUp.saveButton=false;
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
},
// S
getBaseList (val, type) {
this.tagNo = val
@ -599,13 +474,6 @@
this.searchData.sResourceID = val.ResourceID
}
},
initReportModal (row) {
this.scanSeqNo=row.seqNo
this.searchSeqNo()
},
closeDialog () {
Object.assign(this.$data.saveHeaderData, this.$options.data.call(this).saveHeaderData)
},
search () {
getSOScheduleRoutingData(this.searchData).then(({data}) => {
this.tableData = data.rows
@ -643,18 +511,13 @@
this.$nextTick(() => { this.$refs.start.focus();})
},
searchSeqNo(){
if(this.scanSeqNo==''){
this.$alert("请扫描派工单!",'错误', {
confirmButtonText: '确定'
})
return false;
}
let inData={
userId:this.$store.state.user.name,
seqNo:this.scanSeqNo
username:this.$store.state.user.name,
seqNo:this.scanSeqNo,
}
searchSeqNo(inData).then(({data}) => {
if (data.code == 0) {
toolStart(inData).then(({data}) => {
if (data && data.code === 0) {
this.scanModalFlag=false;
if(data.row==null){
this.scanSeqNo=''
this.$alert("派工单不存在!",'错误', {
@ -663,19 +526,13 @@
return false;
}
let currentData = data.row;
if(currentData.closedFlag=='Y'){
this.scanSeqNo=''
this.$alert("该派工单已关闭!",'错误', {
confirmButtonText: '确定'
})
return false;
}
this.saveHeaderData.qtyApprove=0
this.saveHeaderData.qtyUnApprove=0
this.saveHeaderData.qtyRework=0
this.saveHeaderData.moldQty=0
this.saveHeaderData.reportWeight=0
this.saveHeaderData.approveWeight=0
// 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;
@ -684,46 +541,14 @@
this.saveHeaderData.partDescription = currentData.partSpec;
this.saveHeaderData.workCenterNo = currentData.sWorkCenterNo;
this.saveHeaderData.workCenterDesc = currentData.workCenterDesc;
this.saveHeaderData.orderRef1=currentData.orderRef1;
this.saveHeaderData.orderNo=currentData.orderNo;
this.saveHeaderData.scheduleType=currentData.scheduleType;
this.saveHeaderData.operatorId=currentData.operatorId;
this.saveHeaderData.operatorName=currentData.operatorName;
this.saveHeaderData.qtyRequire=currentData.qtyRequired;
this.saveHeaderData.userId=this.$store.state.user.name;
this.saveHeaderData.manufacturingTime='';
this.qty1='';
this.qty2 ='';
this.saveHeaderData.planStartTime = this.dayjs(new Date()).format('YYYY-MM-DD 00:00:00')
this.saveHeaderData.planFinishTime = this.dayjs(new Date()).format('YYYY-MM-DD 00:00:00')
searchReportedQty(this.saveHeaderData).then(({data}) => {
if(data.code===0) {
this.qty1 = data.row.qtyReported;
this.qty2 = data.row.lastApproveQty;
}else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
return false;
}
})
this.scanModalFlag=false;
this.setUp.reviewFlag = true;
this.setUp.saveButton=false;
this.setUp.disabled = true;
// getSOScheduleRoutingData(inData).then(({data}) => {
// if( data.rows){
// if(data.rows.length>0){
// data.rows[0].weight= Number(data.rows[0].weight.toFixed(2))
// data.rows[0].type='jianyan'
//
//
// }
// }
// })
this.toolList1=data.rows;
this.setUp.reviewFlag=true;
this.toolReportFlag=true;
this.toolInstanceID='';
this.pageTitle='工具报工'
this.$nextTick(() => { this.$refs.report.focus();})
} else {
this.scanSeqNo=''
this.scanSeqNo='';
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
@ -736,17 +561,39 @@
username:this.$store.state.user.name,
seqNo:this.scanSeqNo,
}
startSeqNo(inData).then(({data}) => {
toolStart(inData).then(({data}) => {
if (data && data.code === 0) {
this.scanSeqNo='';
this.startModalFlag=false;
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
}
})
if(data.row==null){
this.scanSeqNo=''
this.$alert("派工单不存在!",'错误', {
confirmButtonText: '确定'
})
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;
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.toolList1=data.rows;
this.setUp.reviewFlag=true;
this.toolReportFlag=false;
this.toolInstanceID='';
this.pageTitle='工具领用'
this.$nextTick(() => { this.$refs.issuance.focus();})
} else {
this.scanSeqNo='';
this.$alert(data.msg, '错误', {
@ -755,6 +602,48 @@
}
})
},
toolIssuance(){
this.$confirm(`确定领用此工具?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
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,
}
toolIssuance(inData).then(({data}) => {
if (data && data.code === 0) {
let inData={
username:this.$store.state.user.name,
seqNo:this.scanSeqNo,
}
toolStart(inData).then(({data}) => {
if (data && data.code === 0) {
this.toolList1=data.rows;
}
})
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
}
})
} else {
this.scanSeqNo='';
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
}).catch(() => {
})
}
},
created () {

Loading…
Cancel
Save