|
|
|
@ -6,11 +6,17 @@ import { |
|
|
|
saveRework, |
|
|
|
getRework, |
|
|
|
removeRework, |
|
|
|
cancelRework, queryOperator, getPackagePrintDataList, getSOScheduleRoutingDataPrint, checkIsPacking |
|
|
|
cancelRework, |
|
|
|
queryOperator, |
|
|
|
getPackagePrintDataList, |
|
|
|
getSOScheduleRoutingDataPrint, |
|
|
|
checkIsPacking, |
|
|
|
packagePrintDataList |
|
|
|
} from '../../../api/production/generateReport' |
|
|
|
import dayjs from 'dayjs' |
|
|
|
import decimal, {Decimal} from 'decimal.js' |
|
|
|
import {printPackageLabelNoPreview} from "../print/print_package_label-NOOREVIEW"; |
|
|
|
import {format} from "nightwatch/lib/util/utils"; |
|
|
|
export default { |
|
|
|
components:{ |
|
|
|
chooseList, |
|
|
|
@ -41,7 +47,6 @@ export default { |
|
|
|
site:this.$store.state.user.site, |
|
|
|
type:undefined, |
|
|
|
}, |
|
|
|
weight:0, |
|
|
|
soScheduleRouting: {}, |
|
|
|
printDataList: [], |
|
|
|
reportWorkDialog:false, |
|
|
|
@ -130,6 +135,21 @@ export default { |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
printLabel2(row){ |
|
|
|
// this.$message.success(row) |
|
|
|
row.printQty = row.qualifiedQty |
|
|
|
packagePrintDataList(row).then(({data}) => { |
|
|
|
this.$message.success(data) |
|
|
|
if (data && data.code === 0) { |
|
|
|
data.rows[0].tcpValue = 0 |
|
|
|
data.rows[0].inspector = row.operatorId |
|
|
|
// data.rows[0].receiveDate = row.createTime |
|
|
|
printPackageLabelNoPreview(data.rows) |
|
|
|
} else { |
|
|
|
this.$message.warning(data.msg) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
clickReportWork(row,type){ |
|
|
|
this.saveRework = {...row} |
|
|
|
this.saveRework.reworkStartDate = new Date() |
|
|
|
@ -213,6 +233,12 @@ export default { |
|
|
|
if (data && data.code === 0){ |
|
|
|
this.$message.success(data.msg) |
|
|
|
this.reportWorkDialog = false; |
|
|
|
console.log("***"+this.saveRework.seqNo) |
|
|
|
//打印功能 |
|
|
|
this.unitQty = this.saveRework.qualifiedQty |
|
|
|
this.createTime2 = this.saveRework.createTime2 |
|
|
|
this.operatorId = this.saveRework.operatorId |
|
|
|
this.getSOScheduleRoutingData(this.saveRework.seqNo) |
|
|
|
this.selectRework(); |
|
|
|
}else { |
|
|
|
this.$alert(data.msg, '错误信息', { |
|
|
|
@ -253,7 +279,7 @@ export default { |
|
|
|
this.soScheduleRouting.operatorName2 = data.data.operatorName; |
|
|
|
this.soScheduleRouting.approveQty2 = data.data.qtyApprove; |
|
|
|
} |
|
|
|
this.printLabel() |
|
|
|
this.printLabel(seqNo) |
|
|
|
} else { |
|
|
|
this.$message.warning(data.msg) |
|
|
|
} |
|
|
|
@ -276,11 +302,11 @@ export default { |
|
|
|
this.soScheduleRouting = {} |
|
|
|
}) |
|
|
|
}, |
|
|
|
printLabel() { |
|
|
|
if (!this.saveRework.seqNo ||this.saveRework.seqNo=='' || this.saveRework.seqNo == null){ |
|
|
|
this.$message.warning("请输入描派工单号"); |
|
|
|
return; |
|
|
|
} |
|
|
|
printLabel(seqNo) { |
|
|
|
// if (!this.saveRework.seqNo || this.saveRework.seqNo=='' || this.saveRework.seqNo == null){ |
|
|
|
// this.$message.warning("请输入描派工单号"); |
|
|
|
// return; |
|
|
|
// } |
|
|
|
if (!this.soScheduleRouting.site) { |
|
|
|
this.$message.warning("请先扫描派工单号") |
|
|
|
return |
|
|
|
@ -293,7 +319,7 @@ export default { |
|
|
|
previousSeqNo: this.soScheduleRouting.previousSeqNo, |
|
|
|
site: this.soScheduleRouting.site, |
|
|
|
orderNo: this.soScheduleRouting.orderNo, |
|
|
|
seqNo: this.saveRework.seqNo |
|
|
|
seqNo: seqNo |
|
|
|
} |
|
|
|
this.printPackageLabelNoPreview(params) |
|
|
|
}, |
|
|
|
@ -304,13 +330,12 @@ export default { |
|
|
|
} |
|
|
|
// 发起请求 |
|
|
|
getPackagePrintDataList(params).then(({data}) => { |
|
|
|
|
|
|
|
this.printDataList = data.rows |
|
|
|
this.printDataList.forEach(item => { |
|
|
|
item.receiveDate = this.saveRework.createTime2 |
|
|
|
item.inspector = this.saveRework.operatorId |
|
|
|
item.unitQty = this.saveRework.qtyApprove |
|
|
|
item.tcpValue = this.weight |
|
|
|
item.receiveDate = this.createTime2 |
|
|
|
item.inspector = this.operatorId |
|
|
|
item.unitQty = this.unitQty |
|
|
|
item.tcpValue = 0 |
|
|
|
}) |
|
|
|
if (data && data.code === 0) { |
|
|
|
printPackageLabelNoPreview(this.printDataList); |
|
|
|
@ -329,7 +354,6 @@ export default { |
|
|
|
let params = { |
|
|
|
seqNo: this.saveRework.seqNo |
|
|
|
} |
|
|
|
let seqNo = this.saveRework.seqNo |
|
|
|
getRework(params).then(({data})=>{ |
|
|
|
if (data && data.code === 0){ |
|
|
|
this.seqNoReworkRecordDialog = false; |
|
|
|
@ -340,8 +364,6 @@ export default { |
|
|
|
this.saveRework.productionTime = new Decimal(dayjs(new Date()).diff(this.saveRework.createTime,'hour',true)).toFixed(2, Decimal.ROUND_HALF_UP) |
|
|
|
this.saveRework.productionTime = new Decimal(this.saveRework.productionTime).toSignificantDigits() |
|
|
|
}) |
|
|
|
//打印功能 |
|
|
|
this.getSOScheduleRoutingData(seqNo) |
|
|
|
this.reportWorkDialog = true |
|
|
|
}else { |
|
|
|
this.$alert(data.msg, '错误信息', { |
|
|
|
@ -483,10 +505,6 @@ export default { |
|
|
|
<el-form-item label="派工单号" prop="seqNo"> |
|
|
|
<el-input ref="seqNoR" type="number" v-model="saveRework.seqNo" @keydown.native.enter="getRework"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="打印标签-重量"> |
|
|
|
<el-input-number size="medium" style="width: 100%;text-align: left" :controls="false" ref="dialogInput" |
|
|
|
:min="1" v-model="weight"></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<el-footer style="height:40px;margin-top: 20px;text-align:center"> |
|
|
|
<el-button type="primary" @click="getRework">确定</el-button> |
|
|
|
@ -782,13 +800,14 @@ export default { |
|
|
|
<el-table-column |
|
|
|
header-align="center" |
|
|
|
align="center" |
|
|
|
width="100" |
|
|
|
width="125" |
|
|
|
label="操作"> |
|
|
|
<template slot-scope="scope" class="foo_container"> |
|
|
|
<a style="cursor: pointer;" v-if="scope.row.reworkStatus === '返工中'" @click="clickReportWork(scope.row)">报工</a> |
|
|
|
<a style="cursor: pointer;" v-if="scope.row.reworkStatus === '已结束'" @click="cancelReportWork(scope.row)">取消</a> |
|
|
|
<a style="cursor: pointer;" @click="removeReportWork(scope.row)">删除</a> |
|
|
|
<a style="cursor: pointer;" @click="clickReportWork(scope.row,0)">详情</a> |
|
|
|
<a style="cursor: pointer;" @click="printLabel2(scope.row)">补打</a> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
|