Browse Source

0412 新看板

master
ruanqi 3 years ago
parent
commit
f009403e53
  1. 1
      src/api/production.js
  2. 7
      src/api/production/generateReport.js
  3. 4
      src/assets/scss/global.scss
  4. 10
      src/views/modules/pad/padPartPhoto.vue
  5. 262
      src/views/modules/production/generateReport.vue
  6. 515
      src/views/modules/production/generateReport_old.vue
  7. 102
      src/views/modules/production/scheduleForSOTask.vue

1
src/api/production.js

@ -47,6 +47,7 @@ export const getWorkCenterOperatorList=data => createAPI(`dailyPlan/getWorkCente
export const getAvailableResourceList=data => createAPI(`dailyPlan/getAvailableResourceList`, 'post', data);
export const scheduleForShopOrder=data => createAPI(`dailyPlan/scheduleForShopOrder`, 'post', data);
export const scheduleForSOTask=data => createAPI(`dailyPlan/scheduleForSOTask`, 'post', data);

7
src/api/production/generateReport.js

@ -5,3 +5,10 @@ export const getGenerateReportList = data => createAPI(`dailyPlan/getGenerateRep
// 获取生产报告信息
export const saveGenerateReport = data => createAPI(`dailyPlan/saveGenerateReport`, 'post', data);
// 获取生产报告信息
export const getSOScheduleRoutingData = data => createAPI(`dailyPlan/getSOScheduleRoutingData`, 'post', data);
// 获取生产报告信息
export const saveGenerateReportForSchedule = data => createAPI(`dailyPlan/saveGenerateReportForSchedule`, 'post', data);

4
src/assets/scss/global.scss

@ -208,4 +208,6 @@ a:hover{
.mainTable .hover-row > td{
background-color: transparent !important;
}
.padPhoto .img{
object-fit: cover;
}

10
src/views/modules/pad/padPartPhoto.vue

@ -92,8 +92,8 @@
}
this.fileName=this.photoDatas[this.num-1].attaFileNameDb;
this.fileTitle="文件名 ("+this.num+"/"+this.photoDatas.length+")";
this.photoUrl='http://192.168.2.172/upload/'+this.photoDatas[this.num-1].attaFileNameDb;
// this.photoUrl='http://192.168.1.83/upload/'+this.photoDatas[this.num-1].attaFileNameDb;
// this.photoUrl='http://192.168.2.172/upload/'+this.photoDatas[this.num-1].attaFileNameDb;
this.photoUrl='http://192.168.1.83/upload/'+this.photoDatas[this.num-1].attaFileNameDb;
})
},
nextPicture(){
@ -111,7 +111,8 @@
}
this.fileName=this.photoDatas[this.num-1].attaFileNameDb;
this.fileTitle="文件名 ("+this.num+"/"+this.photoDatas.length+")";
this.photoUrl='http://192.168.2.172/upload/'+this.photoDatas[this.num-1].attaFileNameDb;
// this.photoUrl='http://192.168.2.172/upload/'+this.photoDatas[this.num-1].attaFileNameDb;
this.photoUrl='http://192.168.1.83/upload/'+this.photoDatas[this.num-1].attaFileNameDb;
},
lastPicture(){
if(this.photoDatas.length==0){
@ -128,7 +129,8 @@
}
this.fileName=this.photoDatas[this.num-1].attaFileNameDb;
this.fileTitle="文件名 ("+this.num+"/"+this.photoDatas.length+")";
this.photoUrl='http://192.168.2.172/upload/'+this.photoDatas[this.num-1].attaFileNameDb;
// this.photoUrl='http://192.168.2.172/upload/'+this.photoDatas[this.num-1].attaFileNameDb;
this.photoUrl='http://192.168.1.83/upload/'+this.photoDatas[this.num-1].attaFileNameDb;
},
},
created () {

262
src/views/modules/production/generateReport.vue

@ -6,7 +6,7 @@
</el-form-item>
<el-form-item >
<span slot="label" style="" @click="getBaseList(24)"><a herf="#">加工中心编码</a></span>
<el-input v-model="searchData.workCenterNo" style="width: 120px"></el-input>
<el-input v-model="searchData.sWorkCenterNo" style="width: 120px"></el-input>
</el-form-item>
<el-form-item >
<span slot="label" style="" @click="getBaseList(5)"><a herf="#">产品编码</a></span>
@ -47,109 +47,123 @@
</template>
</el-table-column>
<el-table-column
prop="orderNo"
prop="seqNo"
header-align="center"
align="left"
min-width="100"
label="生产订单号">
min-width="80"
label="派工单号">
</el-table-column>
<el-table-column
prop="itemNo"
prop="orderNo"
header-align="center"
align="right"
min-width="50"
label="工序号">
align="left"
min-width="100"
label="关联单号">
</el-table-column>
<el-table-column
prop="operationDesc"
prop="scheduleType"
header-align="center"
align="left"
min-width="70"
label="工序名称">
min-width="80"
label="关联单号类型">
</el-table-column>
<el-table-column
prop="workCenterNo"
prop="itemNo"
header-align="center"
align="left"
min-width="70"
label="加工中心">
label="工序号">
</el-table-column>
<el-table-column
prop="workCenterDesc"
prop="itemDesc"
header-align="center"
align="left"
min-width="100"
label="加工中心名称">
min-width="160"
label="工序名称">
</el-table-column>
<el-table-column
prop="qtyRequired"
header-align="center"
align="right"
min-width="70"
label="需求数量">
min-width="80"
label="派工数量">
</el-table-column>
<el-table-column
prop="qtyReported"
header-align="center"
align="right"
min-width="70"
label="报数量">
min-width="80"
label="报数量">
</el-table-column>
<el-table-column
prop="qtyApprove"
header-align="center"
align="right"
min-width="70"
min-width="80"
label="合格数量">
</el-table-column>
<el-table-column
prop="timeRequired"
header-align="center"
align="right"
min-width="70"
min-width="80"
label="需求时间">
</el-table-column>
<el-table-column
prop="timeReported"
prop="sScheduledDate"
header-align="center"
align="right"
min-width="70"
label="报告时间">
align="left"
min-width="80"
label="派工日期">
</el-table-column>
<el-table-column
prop="operatorName"
header-align="center"
align="left"
min-width="80"
label="操作员姓名">
</el-table-column>
<el-table-column
prop="partNo"
header-align="center"
align="left"
min-width="70"
label="产品编码">
min-width="80"
label="物料编码">
</el-table-column>
<el-table-column
prop="partDescription"
prop="partDesc"
header-align="center"
align="left"
min-width="100"
label="产品名称">
min-width="200"
label="物料名称">
</el-table-column>
<el-table-column
prop="lotSize"
prop="sResourceID"
header-align="center"
align="right"
align="left"
min-width="70"
label="订单数量">
label="机台ID">
</el-table-column>
<el-table-column
prop="status"
prop="sShiftNo"
header-align="center"
align="left"
min-width="70"
label="订单状态">
label="班次">
</el-table-column>
<el-table-column
prop="sWorkCenterNo"
header-align="center"
align="left"
min-width="100"
label="加工中心编码">
</el-table-column>
</el-table>
<el-dialog @close="closeDialog" :close-on-click-modal="false" :close-on-press-escape="false" v-drag title="报告信息" :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.orderNo"></el-input>
<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-form-item>
<el-form-item label="产品编码">
<el-input style="width: 130px;" :disabled="setUp.disabled" v-model="saveHeaderData.partNo"></el-input>
@ -256,22 +270,67 @@
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="SOPModal()" type="primary">查看SOP</el-button>
<el-button @click="setUp.reviewFlag = false">取消</el-button>
<el-button type="primary" :disabled="setUp.saveButton" @click="saveReport()">确定</el-button>
</span>
</el-dialog>
<el-dialog :close-on-click-modal="false" :close-on-press-escape="false" v-drag title="查看SOP" :visible.sync="sopFlag" width="80%">
<el-row>
<el-col :span="8">
<div style="margin-top: 2%">
<h5 style="margin-left: 0px;font-size: 20px">产品图片</h5>
<el-form inline="true" style="margin-top: -5px;margin-left: 0px" label-position="top">
<el-form-item :label="'工厂编号:'">
<el-input v-model="sopData.site" readonly style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'产品编码:'" style="margin-left: 20px">
<el-input v-model="sopData.partNo" readonly style="width: 120px"></el-input>
</el-form-item>
</el-form>
<el-form inline="true" style="margin-top: 20px;margin-left: 0px" label-position="top">
<el-form-item :label="'产品名称/规格型号:'" style="font-size: 20px">
<el-input v-model="partDescription" readonly style="width: 374px"></el-input>
</el-form-item>
</el-form>
<el-form inline="true" style="margin-top: 20px;margin-left: 0px" label-position="top">
<el-form-item :label="fileTitle">
<el-input v-model="fileName" style="width: 374px" readonly></el-input>
</el-form-item>
</el-form>
<el-form inline="true" style="margin-top: 20px;margin-left: 20px" label-position="top">
<el-form-item :label="' '">
<el-button @click="lastPicture()" type="primary">上一张</el-button>
</el-form-item>
<el-form-item :label="' '">
<el-button @click="nextPicture()" type="primary">下一张</el-button>
</el-form-item>
<el-form-item :label="' '">
<el-button @click="sopFlag=false" type="primary">关闭</el-button>
</el-form-item>
</el-form>
</div>
</el-col>
<el-col :span="16">
<div id="padPhoto" style="text-align: center;vertical-align:middle;" >
<iframe :src="photoUrl" frameborder="0" width="100%" :height="height2"></iframe>
</div>
</el-col>
</el-row>
</el-dialog>
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
</div>
</template>
<script>
import {
getGenerateReportList
, saveGenerateReport
getSOScheduleRoutingData
, saveGenerateReportForSchedule
} from '@/api/production/generateReport.js'
import Chooselist from '@/views/modules/common/Chooselist'
import {
getPhotoAddressData
} from '@/api/pad.js'
export default {
name: 'generateReport',
components: {
@ -287,7 +346,7 @@
},
saveHeaderData: {
site: '',
orderNo: '',
seqNo: '',
itemNo: '',
partNo: '',
partDescription: '',
@ -308,8 +367,12 @@
manufacturingTime: 0,
cleaningTime: 0,
shutdownReason: '',
remark: ''
remark: '',
orderRef1:'',
scheduleType:'',
userId:'',
},
sopFlag:false,
site: this.$store.state.user.site,
operatorType: 0,
// start
@ -335,15 +398,31 @@
date1: '',
searchData: {
orderNo: '',
workCenterNo: '',
sWorkCenterNo: '',
partNo: '',
site: this.$store.state.user.site
}
},
photoUrl:'',
sopData:{
site:'',
partNo:'',
},
partDescription:'',
fileTitle:'',
fileName:'',
num:1,
currentData:'',
photoDatas:[],
uploadImg:[],
showviewer: false,
url: '',
height2:600,
}
},
mounted () {
this.$nextTick(() => {
this.height = window.innerHeight - 210
this.height2 = window.innerHeight -100
})
},
methods: {
@ -354,31 +433,31 @@
})
return
}
if (this.saveHeaderData.qtyApprove == null || this.saveHeaderData.qtyApprove <= 0) {
if (this.saveHeaderData.qtyApprove == null || this.saveHeaderData.qtyApprove < 0) {
this.$alert('合格数量错误!', '错误信息', {
confirmButtonText: '确定'
})
return
}
if (this.saveHeaderData.qtyRework == null || this.saveHeaderData.qtyRework <= 0) {
if (this.saveHeaderData.qtyRework == null || this.saveHeaderData.qtyRework <0) {
this.$alert('返工数量错误!', '错误信息', {
confirmButtonText: '确定'
})
return
}
if (this.saveHeaderData.preparationTime == null || this.saveHeaderData.preparationTime <= 0) {
if (this.saveHeaderData.preparationTime == null || this.saveHeaderData.preparationTime < 0) {
this.$alert('准备时间错误!', '错误信息', {
confirmButtonText: '确定'
})
return
}
if (this.saveHeaderData.manufacturingTime == null || this.saveHeaderData.manufacturingTime <= 0) {
if (this.saveHeaderData.manufacturingTime == null || this.saveHeaderData.manufacturingTime < 0) {
this.$alert('制造时间错误!', '错误信息', {
confirmButtonText: '确定'
})
return
}
if (this.saveHeaderData.cleaningTime == null || this.saveHeaderData.cleaningTime <= 0) {
if (this.saveHeaderData.cleaningTime == null || this.saveHeaderData.cleaningTime < 0) {
this.$alert('清理时间错误!', '错误信息', {
confirmButtonText: '确定'
})
@ -402,7 +481,7 @@
})
return
}
saveGenerateReport(this.saveHeaderData).then(({data}) => {
saveGenerateReportForSchedule(this.saveHeaderData).then(({data}) => {
if (data.code == 0) {
this.$message.success(data.msg)
this.setUp.reviewFlag = false
@ -454,13 +533,18 @@
this.setUp.disabled = true
let currentData = JSON.parse(JSON.stringify(row))
this.saveHeaderData.site = currentData.site
this.saveHeaderData.orderNo = currentData.orderNo
this.saveHeaderData.seqNo = currentData.seqNo
this.saveHeaderData.itemNo = currentData.itemNo
this.saveHeaderData.operationDesc = currentData.operationDesc
this.saveHeaderData.operationDesc = currentData.itemDesc
this.saveHeaderData.partNo = currentData.partNo
this.saveHeaderData.partDescription = currentData.partDescription + '/' + currentData.spec
this.saveHeaderData.workCenterNo = currentData.workCenterNo
this.saveHeaderData.partDescription = currentData.partSpec
this.saveHeaderData.workCenterNo = currentData.sWorkCenterNo
this.saveHeaderData.workCenterDesc = currentData.workCenterDesc
this.saveHeaderData.orderRef1=currentData.orderRef1
this.saveHeaderData.scheduleType=currentData.scheduleType
this.saveHeaderData.operatorId=currentData.operatorId
this.saveHeaderData.operatorName=currentData.operatorName
this.saveHeaderData.userId=this.$store.state.user.name
this.saveHeaderData.planFinishTime = this.dayjs(new Date()).format('YYYY-MM-DD 00:00:00')
this.saveHeaderData.planStartTime = this.dayjs(new Date()).format('YYYY-MM-DD 00:00:00')
},
@ -468,7 +552,7 @@
Object.assign(this.$data.saveHeaderData, this.$options.data.call(this).saveHeaderData)
},
search () {
getGenerateReportList(this.searchData).then(({data}) => {
getSOScheduleRoutingData(this.searchData).then(({data}) => {
this.tableData = data.rows
})
},
@ -491,7 +575,68 @@
let MM = dd.getMinutes() < 10 ? '0' + dd.getMinutes() : dd.getMinutes()
let S = dd.getSeconds() < 10 ? '0' + dd.getSeconds() : dd.getSeconds()
return Y + M + D + H + MM + S
}
},
SOPModal(){
this.sopData.partNo = this.saveHeaderData.partNo;
this.sopData.site= this.saveHeaderData.site;
this.partDescription= this.saveHeaderData.partDescription;
// var div1=document.getElementById("padPhoto");
// div1.style.cssText= "height:"+this.height2+"px;";
this.getPhoto();
this.sopFlag=true;
},
getPhoto(){
getPhotoAddressData(this.sopData).then(({data}) => {
this.photoDatas = data.rows;
if(this.photoDatas.length==0){
this.fileTitle="文件名 ("+0+"/"+0+")";
this.$alert('该物料没有上传图片!', '错误', {
confirmButtonText: '确定'
})
return false;
}
this.fileName=this.photoDatas[this.num-1].attaFileNameDb;
this.fileTitle="文件名 ("+this.num+"/"+this.photoDatas.length+")";
// this.photoUrl='http://192.168.2.172/upload/'+this.photoDatas[this.num-1].attaFileNameDb;
this.photoUrl='http://192.168.1.83/upload/'+this.photoDatas[this.num-1].attaFileNameDb;
})
},
nextPicture(){
if(this.photoDatas.length==0){
this.fileTitle="文件名 ("+0+"/"+0+")";
this.$alert('该物料没有上传图片!', '错误', {
confirmButtonText: '确定'
})
return false;
}
if(this.num==this.photoDatas.length){
this.num=1;
}else{
this.num=this.num+1;
}
this.fileName=this.photoDatas[this.num-1].attaFileNameDb;
this.fileTitle="文件名 ("+this.num+"/"+this.photoDatas.length+")";
// this.photoUrl='http://192.168.2.172/upload/'+this.photoDatas[this.num-1].attaFileNameDb;
this.photoUrl='http://192.168.1.83/upload/'+this.photoDatas[this.num-1].attaFileNameDb;
},
lastPicture(){
if(this.photoDatas.length==0){
this.fileTitle="文件名 ("+0+"/"+0+")";
this.$alert('该物料没有上传图片!', '错误', {
confirmButtonText: '确定'
})
return false;
}
if(this.num==1){
this.num=this.photoDatas.length;
}else{
this.num=this.num-1;
}
this.fileName=this.photoDatas[this.num-1].attaFileNameDb;
this.fileTitle="文件名 ("+this.num+"/"+this.photoDatas.length+")";
// this.photoUrl='http://192.168.2.172/upload/'+this.photoDatas[this.num-1].attaFileNameDb;
this.photoUrl='http://192.168.1.83/upload/'+this.photoDatas[this.num-1].attaFileNameDb;
},
},
created () {
@ -512,4 +657,5 @@
input[type='number'] {
-moz-appearance: textfield !important;
}
</style>

515
src/views/modules/production/generateReport_old.vue

@ -0,0 +1,515 @@
<template>
<div class="mod-config">
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: -20px;">
<el-form-item :label="'生产订单号'">
<el-input v-model="searchData.orderNo" style="width: 120px"></el-input>
</el-form-item>
<el-form-item >
<span slot="label" style="" @click="getBaseList(24)"><a herf="#">加工中心编码</a></span>
<el-input v-model="searchData.workCenterNo" style="width: 120px"></el-input>
</el-form-item>
<el-form-item >
<span slot="label" style="" @click="getBaseList(5)"><a herf="#">产品编码</a></span>
<el-input v-model="searchData.partNo" style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="' '">
<el-button @click="search()" style="margin-left: 0px;margin-top:0px" type="primary">查询</el-button>
<download-excel
:fields="exportDataStandard"
:data="tableData"
type="xlsx"
:name="exportName"
:header="exportHeader"
:footer="exportFooter"
:defaultValue="exportDefaultValue"
:fetch="createExportData"
:before-generate="startDownload"
:before-finish="finishDownload"
worksheet="导出信息"
class="el-button el-button--primary el-button--medium">
{{'导出'}}
</download-excel>
</el-form-item>
</el-form>
<el-table
:height="height"
:data="tableData"
border
style="width: 100%">
<el-table-column
prop=""
header-align="center"
align="center"
min-width="50"
label="操作">
<template slot-scope="scope" class="foo_container">
<a type="text" size="small" @click="initReportModal(scope.row)">报告</a>
</template>
</el-table-column>
<el-table-column
prop="orderNo"
header-align="center"
align="left"
min-width="100"
label="生产订单号">
</el-table-column>
<el-table-column
prop="itemNo"
header-align="center"
align="right"
min-width="50"
label="工序号">
</el-table-column>
<el-table-column
prop="operationDesc"
header-align="center"
align="left"
min-width="70"
label="工序名称">
</el-table-column>
<el-table-column
prop="workCenterNo"
header-align="center"
align="left"
min-width="70"
label="加工中心">
</el-table-column>
<el-table-column
prop="workCenterDesc"
header-align="center"
align="left"
min-width="100"
label="加工中心名称">
</el-table-column>
<el-table-column
prop="qtyRequired"
header-align="center"
align="right"
min-width="70"
label="需求数量">
</el-table-column>
<el-table-column
prop="qtyReported"
header-align="center"
align="right"
min-width="70"
label="报告数量">
</el-table-column>
<el-table-column
prop="qtyApprove"
header-align="center"
align="right"
min-width="70"
label="合格数量">
</el-table-column>
<el-table-column
prop="timeRequired"
header-align="center"
align="right"
min-width="70"
label="需求时间">
</el-table-column>
<el-table-column
prop="timeReported"
header-align="center"
align="right"
min-width="70"
label="报告时间">
</el-table-column>
<el-table-column
prop="partNo"
header-align="center"
align="left"
min-width="70"
label="产品编码">
</el-table-column>
<el-table-column
prop="partDescription"
header-align="center"
align="left"
min-width="100"
label="产品名称">
</el-table-column>
<el-table-column
prop="lotSize"
header-align="center"
align="right"
min-width="70"
label="订单数量">
</el-table-column>
<el-table-column
prop="status"
header-align="center"
align="left"
min-width="70"
label="订单状态">
</el-table-column>
</el-table>
<el-dialog @close="closeDialog" :close-on-click-modal="false" :close-on-press-escape="false" v-drag title="报告信息" :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.orderNo"></el-input>
</el-form-item>
<el-form-item label="产品编码">
<el-input style="width: 130px;" :disabled="setUp.disabled" 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-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-form-item>
<el-form-item label="工序名称">
<el-input style="width: 130px;" :disabled="setUp.disabled" 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-form-item>
<el-form-item label="加工中心名称">
<el-input style="width: 130px;" :disabled="setUp.disabled" 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 type="number" oninput="value=value.replace(/[^\d]/g,'')" class="input_left" style="width: 178px;" v-model="saveHeaderData.qtyReported"></el-input>
<!-- <el-input-number style="width: 178px;text-align: right;" v-model="saveHeaderData.qtyRework" size="medium" :min="0" :controls="false"></el-input-number>-->
</el-form-item>
<el-form-item label="合格数量">
<el-input type="number" style="width: 178px;" oninput="value=value.replace(/[^\d]/g,'')" class="input_reight" v-model="saveHeaderData.qtyApprove"></el-input>
<!-- <el-input-number style="width: 178px;text-align: right;" v-model="saveHeaderData.qtyRework" size="medium" :min="0" :controls="false"></el-input-number>-->
</el-form-item>
<el-form-item label="返工数量">
<el-input type="number" style="width: 178px;" oninput="value=value.replace(/[^\d]/g,'')" v-model="saveHeaderData.qtyRework"></el-input>
<!-- <el-input-number style="width: 178px;text-align: right;" v-model="saveHeaderData.qtyRework" size="medium" :min="0" :controls="false"></el-input-number>-->
</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-item label="清理时间" label-width="0px">
<el-input type="number" style="width: 178px;" v-model="saveHeaderData.cleaningTime"></el-input> <!--oninput ="value=value.replace(/[^0-9.]/g,'')"-->
<!-- :min="0" 最小值 :controls="false" 隐藏减价按钮 -->
<!-- <el-input-number style="width: 178px;text-align: right;" v-model="saveHeaderData.cleaningTime" 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.shutdownReason"></el-input>
</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>
</el-form>
<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>
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
</div>
</template>
<script>
import {
getGenerateReportList
, saveGenerateReport
} from '@/api/production/generateReport.js'
import Chooselist from '@/views/modules/common/Chooselist'
export default {
name: 'generateReport',
components: {
Chooselist
},
data () {
return {
setUp: {
reviewFlag: false,
saveButton: false,
readonlyFlag: false,
disabled: false
},
saveHeaderData: {
site: '',
orderNo: '',
itemNo: '',
partNo: '',
partDescription: '',
operationDesc: '',
workCenterNo: '',
workCenterDesc: '',
operatorId: '',
operatorName: '',
planStartTime: '',
planFinishTime: '',
qtyReported: 0,
qtyApprove: 0,
qtyRework: 0,
operatorId2: '',
operatorIdName2: '',
scrapReason: '',
preparationTime: 0,
manufacturingTime: 0,
cleaningTime: 0,
shutdownReason: '',
remark: ''
},
site: this.$store.state.user.site,
operatorType: 0,
// start
exportData: [],
exportDataStandard: {
'日计划单号': 'orderNo',
'计划日期': 'orderDate',
'订单号': 'orderRef1',
'物料编码': 'partNo',
'物料名称': 'partDescription',
'计划数量': 'orderQty',
'已完工数': 'qtyfinished',
'录入人': 'userName',
'录入时间': 'enterDate'
},
exportName: '日计划列表' + this.getStrDate(),
exportHeader: ['日计划列表'],
exportFooter: [],
exportDefaultValue: '这一行这一列没有数据',
// end
height: 200,
tableData: [],
date1: '',
searchData: {
orderNo: '',
workCenterNo: '',
partNo: '',
site: this.$store.state.user.site
}
}
},
mounted () {
this.$nextTick(() => {
this.height = window.innerHeight - 210
})
},
methods: {
saveReport () {
if (this.saveHeaderData.qtyReported == null || this.saveHeaderData.qtyReported <= 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 == null || this.saveHeaderData.manufacturingTime < 0) {
this.$alert('制造时间错误!', '错误信息', {
confirmButtonText: '确定'
})
return
}
if (this.saveHeaderData.cleaningTime == null || this.saveHeaderData.cleaningTime < 0) {
this.$alert('清理时间错误!', '错误信息', {
confirmButtonText: '确定'
})
return
}
if (parseFloat(this.saveHeaderData.qtyApprove) > parseFloat(this.saveHeaderData.qtyReported)) {
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
}
saveGenerateReport(this.saveHeaderData).then(({data}) => {
if (data.code == 0) {
this.$message.success(data.msg)
this.setUp.reviewFlag = false
this.search()
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
},
// S
getBaseList (val, type) {
this.tagNo = val
this.$nextTick(() => {
let strVal = ''
if (val === 24) {
strVal = this.searchData.workCenterNo
} else if (val === 26) {
this.operatorType = type
if (type === 1) {
strVal = this.saveHeaderData.operatorId
} else if (type === 2) {
strVal = this.saveHeaderData.operatorId2
}
}
this.$refs.baseList.init(val, strVal)
})
},
/* 列表方法的回调 */
getBaseData (val) {
console.log(val)
if (this.tagNo === 24) {
this.searchData.workCenterNo = val.WorkCenterNo
} else if (this.tagNo === 26) {
if (this.operatorType === 1) {
this.saveHeaderData.operatorId = val.OperatorID
this.saveHeaderData.operatorName = val.OperatorName
} else if (this.operatorType === 2) {
this.saveHeaderData.operatorId2 = val.OperatorID
this.saveHeaderData.operatorIdName2 = val.OperatorName
}
} else if (this.tagNo === 5) {
this.searchData.partNo = val.PartNo
}
},
initReportModal (row) {
this.setUp.reviewFlag = true
this.setUp.disabled = true
let currentData = JSON.parse(JSON.stringify(row))
this.saveHeaderData.site = currentData.site
this.saveHeaderData.orderNo = currentData.orderNo
this.saveHeaderData.itemNo = currentData.itemNo
this.saveHeaderData.operationDesc = currentData.operationDesc
this.saveHeaderData.partNo = currentData.partNo
this.saveHeaderData.partDescription = currentData.partDescription + '/' + currentData.spec
this.saveHeaderData.workCenterNo = currentData.workCenterNo
this.saveHeaderData.workCenterDesc = currentData.workCenterDesc
this.saveHeaderData.planFinishTime = this.dayjs(new Date()).format('YYYY-MM-DD 00:00:00')
this.saveHeaderData.planStartTime = this.dayjs(new Date()).format('YYYY-MM-DD 00:00:00')
},
closeDialog () {
Object.assign(this.$data.saveHeaderData, this.$options.data.call(this).saveHeaderData)
},
search () {
getGenerateReportList(this.searchData).then(({data}) => {
this.tableData = data.rows
})
},
createExportData () {
return this.tableData
},
startDownload () {
// this.exportData = this.dataList
},
finishDownload () {
},
getStrDate () {
let dd = new Date()
let Y = dd.getFullYear()
let M = (dd.getMonth() + 1) < 10 ? '0' + (dd.getMonth() + 1) : (dd.getMonth() + 1)// 100
let D = dd.getDate() < 10 ? '0' + dd.getDate() : dd.getDate()// 100
let H = dd.getHours() < 10 ? '0' + dd.getHours() : dd.getHours()
let MM = dd.getMinutes() < 10 ? '0' + dd.getMinutes() : dd.getMinutes()
let S = dd.getSeconds() < 10 ? '0' + dd.getSeconds() : dd.getSeconds()
return Y + M + D + H + MM + S
}
},
created () {
}
}
</script>
<style scoped>
.input_left{
text-align: left;
}
.input_reight{
text-align: right;
}
/deep/ input::-webkit-inner-spin-button {
-webkit-appearance: none !important;
}
input[type='number'] {
-moz-appearance: textfield !important;
}
</style>

102
src/views/modules/production/scheduleForSOTask.vue

@ -265,7 +265,7 @@
<el-form-item label="本次累计派工数量:">
<el-input v-model="schedulingModalData.sumQty" type="number" disabled style="width: 120px"></el-input>
<el-button type="primary" @click="addPlans()" style="margin-left: 10px;">添加</el-button>
<el-button type="primary" @click="savePlans()">保存</el-button>
<el-button type="primary" @click="saveSchedule()">保存</el-button>
</el-form-item>
</el-form>
<div class="inputTable ">
@ -374,6 +374,7 @@
getSOTastRoutingData,
getWorkCenterOperatorList,
getAvailableResourceList,
scheduleForSOTask,
} from "@/api/production.js"
export default {
@ -437,6 +438,7 @@
sumQty: '',
orderDate:'',
operatorId:'',
efficiency:'',
},
scheduledModalFlag: false,
availableResourceList: [],
@ -495,6 +497,7 @@
itemNo: row.itemNo,
operationDesc: row.operationDesc,
workCenterNo: row.workCenterNo,
efficiency:row.efficiency,
orderDate: row.orderDate,
scheduleDate: '',
scheduleQty: '',
@ -528,7 +531,6 @@
shiftNo: this.schedulingModalData.shiftNo,
scheduleDate: null,
operatorId:this.schedulingModalData.operatorId,
selectList: []
})
this.sumQty += this.schedulingModalData.scheduleQty
},
@ -566,6 +568,102 @@
this.availableResourceList = data.rows;
})
},
saveSchedule(){
if(this.schedulingModalTableData.length==0){
this.$alert('请添加派工记录!', '错误', {
confirmButtonText: '确定'
})
return false
}
if(this.schedulingModalData.qtyToSchedule<this.schedulingModalData.sumQty){
this.$alert('实际派工数量大于可派工数量!', '错误', {
confirmButtonText: '确定'
})
return false
}
let flag=false;
for (let i = 0; i <this.schedulingModalTableData.length; i++) {
if(''==this.schedulingModalTableData[i].scheduleQty||this.schedulingModalTableData[i].scheduleQty==null){
this.$alert('存在派工记录没有填写派工数量!', '错误', {
confirmButtonText: '确定'
})
return false
}
if(''==this.schedulingModalTableData[i].resourceId||this.schedulingModalTableData[i].resourceId==null){
this.$alert('存在派工记录没有选择机台!', '错误', {
confirmButtonText: '确定'
})
return false
}
if(''==this.schedulingModalTableData[i].shiftNo||this.schedulingModalTableData[i].shiftNo==null){
this.$alert('存在派工记录没有选择班次!', '错误', {
confirmButtonText: '确定'
})
return false
}
if(''==this.schedulingModalTableData[i].scheduleDate||this.schedulingModalTableData[i].scheduleDate==null){
this.$alert('存在派工记录没有填写日期!', '错误', {
confirmButtonText: '确定'
})
return false
}
if(''==this.schedulingModalTableData[i].operatorId||this.schedulingModalTableData[i].operatorId==null){
this.$alert('存在派工记录没有选择操作员!', '错误', {
confirmButtonText: '确定'
})
return false
}
if(this.schedulingModalTableData[i].scheduleDate!=this.schedulingModalData.orderDate){
flag=true;
}
}
if(flag){
this.$confirm(`派工日期不是排产日期,是否继续`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.doSchedule();
})
}else {
this.doSchedule();
}
},
doSchedule(){
let indata={
orderNo: this.schedulingModalData.orderNo,
site: this.schedulingModalData.site,
orderDate: this.schedulingModalData.orderDate,
partNo: this.schedulingModalData.partNo,
itemNo: this.schedulingModalData.itemNo,
workCenterNo: this.schedulingModalData.workCenterNo,
sumQty: this.schedulingModalData.sumQty,
scheduleDetail:this.schedulingModalTableData,
efficiency:this.schedulingModalData.efficiency,
orderRef1:this.schedulingModalData.orderRef1
}
scheduleForSOTask(indata).then(({data}) => {
if (data && data.code === 0) {
this.scheduledModalFlag = false
for (let i = 0; i <this.tableData.length ; i++) {
if(this.tableData[i].orderNo==indata.orderNo &&this.tableData[i].itemNo==indata.itemNo){
this.tableData[i].scheduledQty=data.qty;
}
}
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
}
},
created() {
}

Loading…
Cancel
Save