|
|
@ -1,5 +1,11 @@ |
|
|
<script> |
|
|
<script> |
|
|
import {getPartValue, removeScanLabel, saveScanLabel, scanLabel, queryStandardWeight} from "../../../api/production/generateReport"; |
|
|
|
|
|
|
|
|
import { |
|
|
|
|
|
getPartValue, |
|
|
|
|
|
removeScanLabel, |
|
|
|
|
|
saveScanLabel, |
|
|
|
|
|
scanLabel, |
|
|
|
|
|
queryEarlierInboundBagList |
|
|
|
|
|
} from "../../../api/production/generateReport"; |
|
|
import dayjs from "dayjs"; |
|
|
import dayjs from "dayjs"; |
|
|
import {Decimal} from "decimal.js"; |
|
|
import {Decimal} from "decimal.js"; |
|
|
import {getPhotoAddressData} from "../../../api/pad"; |
|
|
import {getPhotoAddressData} from "../../../api/pad"; |
|
|
@ -91,6 +97,13 @@ export default { |
|
|
"扫描时间": "createData", |
|
|
"扫描时间": "createData", |
|
|
}, |
|
|
}, |
|
|
exportName: "发货扫描"+dayjs().format("YYYYMMDDHHmmss"), |
|
|
exportName: "发货扫描"+dayjs().format("YYYYMMDDHHmmss"), |
|
|
|
|
|
fifoDialogVisible:false, |
|
|
|
|
|
fifoLoading:false, |
|
|
|
|
|
fifoQuery:{ |
|
|
|
|
|
label:'' |
|
|
|
|
|
}, |
|
|
|
|
|
fifoList:[], |
|
|
|
|
|
fifoCurrentLabel:{} |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
methods:{ |
|
|
methods:{ |
|
|
@ -126,6 +139,98 @@ export default { |
|
|
this.$message.error(error) |
|
|
this.$message.error(error) |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
// 手工查询先进先出袋贴 - rqrq |
|
|
|
|
|
openFifoDialog(){ |
|
|
|
|
|
this.fifoDialogVisible = true |
|
|
|
|
|
this.fifoQuery.label = '' |
|
|
|
|
|
this.fifoList = [] |
|
|
|
|
|
this.fifoCurrentLabel = {} |
|
|
|
|
|
}, |
|
|
|
|
|
// 弹框扫描口聚焦 - rqrq |
|
|
|
|
|
focusFifoScanInput(){ |
|
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
|
if (this.$refs.fifoScanInput){ |
|
|
|
|
|
this.$refs.fifoScanInput.focus() |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
// 解析袋贴标签内容:site;partNo;qty;seqNo;printId;weight - rqrq |
|
|
|
|
|
parseBagLabelForFifo(){ |
|
|
|
|
|
const label = (this.fifoQuery.label || '').trim() |
|
|
|
|
|
const arr = label.split(';') |
|
|
|
|
|
if (arr.length < 5){ |
|
|
|
|
|
this.$message.warning("标签格式错误") |
|
|
|
|
|
return null |
|
|
|
|
|
} |
|
|
|
|
|
if (!arr[3]){ |
|
|
|
|
|
this.$message.warning("标签jobNo为空") |
|
|
|
|
|
return null |
|
|
|
|
|
} |
|
|
|
|
|
if (!arr[4]){ |
|
|
|
|
|
this.$message.warning("标签序号为空") |
|
|
|
|
|
return null |
|
|
|
|
|
} |
|
|
|
|
|
if (!arr[1]){ |
|
|
|
|
|
this.$message.warning("产品编码为空") |
|
|
|
|
|
return null |
|
|
|
|
|
} |
|
|
|
|
|
if (!arr[0]){ |
|
|
|
|
|
this.$message.warning("site编码为空") |
|
|
|
|
|
return null |
|
|
|
|
|
} |
|
|
|
|
|
const seqNo = Number(arr[3]) |
|
|
|
|
|
const itemNo = Number(arr[4]) |
|
|
|
|
|
if (!Number.isFinite(seqNo) || !Number.isFinite(itemNo)){ |
|
|
|
|
|
this.$message.warning("标签格式错误") |
|
|
|
|
|
return null |
|
|
|
|
|
} |
|
|
|
|
|
return { |
|
|
|
|
|
site:arr[0], |
|
|
|
|
|
partNo:arr[1], |
|
|
|
|
|
seqNo:seqNo, |
|
|
|
|
|
printId:itemNo |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
// 查询比当前袋贴日期更早、且未扫描的已入库袋贴 - rqrq |
|
|
|
|
|
queryFifoListByLabel(){ |
|
|
|
|
|
const params = this.parseBagLabelForFifo() |
|
|
|
|
|
if (!params){ |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
this.fifoLoading = true |
|
|
|
|
|
queryEarlierInboundBagList(params).then(({data})=>{ |
|
|
|
|
|
this.fifoLoading = false |
|
|
|
|
|
if (data && data.code === 0){ |
|
|
|
|
|
this.fifoCurrentLabel = data.row || {} |
|
|
|
|
|
this.fifoList = data.rows || [] |
|
|
|
|
|
if (this.fifoList.length === 0){ |
|
|
|
|
|
this.$message.success("未查询到更早日期袋贴") |
|
|
|
|
|
} else { |
|
|
|
|
|
this.$message.warning("查询到更早日期袋贴,请优先使用") |
|
|
|
|
|
} |
|
|
|
|
|
// 扫码成功后清空扫描口,并保持焦点 - rqrq |
|
|
|
|
|
this.fifoQuery.label = '' |
|
|
|
|
|
this.focusFifoScanInput() |
|
|
|
|
|
}else { |
|
|
|
|
|
this.$message.warning(data.msg) |
|
|
|
|
|
} |
|
|
|
|
|
}).catch((error)=>{ |
|
|
|
|
|
this.fifoLoading = false |
|
|
|
|
|
this.$message.error(error) |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
formatLabelDate(row){ |
|
|
|
|
|
if (!row || !row.createTime){ |
|
|
|
|
|
return '' |
|
|
|
|
|
} |
|
|
|
|
|
return dayjs(row.createTime).format("YYYY-MM-DD") |
|
|
|
|
|
}, |
|
|
|
|
|
getFifoCurrentLabelDate(){ |
|
|
|
|
|
if (!this.fifoCurrentLabel || !this.fifoCurrentLabel.createTime){ |
|
|
|
|
|
return '' |
|
|
|
|
|
} |
|
|
|
|
|
return dayjs(this.fifoCurrentLabel.createTime).format("YYYY-MM-DD") |
|
|
|
|
|
}, |
|
|
scanLabel(){ |
|
|
scanLabel(){ |
|
|
let paramsScan={ |
|
|
let paramsScan={ |
|
|
site:this.detail.site, |
|
|
site:this.detail.site, |
|
|
@ -219,6 +324,10 @@ export default { |
|
|
label: '', |
|
|
label: '', |
|
|
flag: '', |
|
|
flag: '', |
|
|
} |
|
|
} |
|
|
|
|
|
this.fifoDialogVisible = false |
|
|
|
|
|
this.fifoQuery.label = '' |
|
|
|
|
|
this.fifoList = [] |
|
|
|
|
|
this.fifoCurrentLabel = {} |
|
|
if (this.isReport === false && this.total < this.notifyQty){ |
|
|
if (this.isReport === false && this.total < this.notifyQty){ |
|
|
this.$message.warning("扫描数量未达到通知单数量") |
|
|
this.$message.warning("扫描数量未达到通知单数量") |
|
|
// this.$alert("扫描数量未达到通知单数量", '提示', { |
|
|
// this.$alert("扫描数量未达到通知单数量", '提示', { |
|
|
@ -255,6 +364,13 @@ export default { |
|
|
changePhoto(index){ |
|
|
changePhoto(index){ |
|
|
this.num=index+1; |
|
|
this.num=index+1; |
|
|
} |
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
watch:{ |
|
|
|
|
|
fifoDialogVisible(newVal){ |
|
|
|
|
|
if (newVal){ |
|
|
|
|
|
this.focusFifoScanInput() |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
@ -292,6 +408,9 @@ export default { |
|
|
<el-form-item label="标准袋重量"> |
|
|
<el-form-item label="标准袋重量"> |
|
|
<el-input-number disabled :controls="false" style="margin-top: -5px;text-align: right" v-model="detail.standardWeight"></el-input-number> |
|
|
<el-input-number disabled :controls="false" style="margin-top: -5px;text-align: right" v-model="detail.standardWeight"></el-input-number> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item label=" " v-if="!isReport"> |
|
|
|
|
|
<el-button type="warning" style="height: 20px;font-size: 14px;line-height: 10px" @click="openFifoDialog">查询先进先出</el-button> |
|
|
|
|
|
</el-form-item> |
|
|
<el-form-item label=" " v-if="isReport"> |
|
|
<el-form-item label=" " v-if="isReport"> |
|
|
<download-excel |
|
|
<download-excel |
|
|
:fields="exportDataStandard" |
|
|
:fields="exportDataStandard" |
|
|
@ -364,6 +483,53 @@ export default { |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
<!-- 子弹窗关闭遮罩层,避免多弹窗叠加后界面过黑 - rqrq --> |
|
|
|
|
|
<el-dialog :visible.sync="fifoDialogVisible" v-drag :close-on-click-modal="false" :modal="false" append-to-body destroy-on-close title="查询先进先出" width="1300px"> |
|
|
|
|
|
<el-row :gutter="20"> |
|
|
|
|
|
<el-col :span="17"> |
|
|
|
|
|
<el-form :inline="true" label-position="top"> |
|
|
|
|
|
<el-form-item label="扫描袋贴"> |
|
|
|
|
|
<el-input ref="fifoScanInput" v-model="fifoQuery.label" clearable @keyup.enter.native="queryFifoListByLabel"></el-input> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item label=" "> |
|
|
|
|
|
<el-button type="primary" :loading="fifoLoading" @click="queryFifoListByLabel">查询</el-button> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-form> |
|
|
|
|
|
<el-table :data="fifoList" border stripe v-loading="fifoLoading" height="420"> |
|
|
|
|
|
<el-table-column prop="partNo" label="产品编码" min-width="120" header-align="center" align="left"></el-table-column> |
|
|
|
|
|
<el-table-column prop="partDesc" label="产品规格" min-width="180" header-align="center" align="left" show-overflow-tooltip></el-table-column> |
|
|
|
|
|
<el-table-column prop="seqNo" label="Pack NO." min-width="90" header-align="center" align="left"></el-table-column> |
|
|
|
|
|
<el-table-column prop="createTime" label="标签日期" min-width="110" header-align="center" align="center" :formatter="formatLabelDate"></el-table-column> |
|
|
|
|
|
<el-table-column prop="printQty" label="数量" min-width="90" header-align="center" align="right"></el-table-column> |
|
|
|
|
|
<el-table-column prop="warehouseId" label="仓库" min-width="90" header-align="center" align="left"></el-table-column> |
|
|
|
|
|
<el-table-column prop="locationId" label="库位" min-width="90" header-align="center" align="left"></el-table-column> |
|
|
|
|
|
<el-table-column prop="status" label="状态" min-width="90" header-align="center" align="center"></el-table-column> |
|
|
|
|
|
</el-table> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<el-col :span="7"> |
|
|
|
|
|
<el-card shadow="always"> |
|
|
|
|
|
<div slot="header" style="font-weight: bold">当前扫描袋贴</div> |
|
|
|
|
|
<el-form label-position="top" label-width="100px"> |
|
|
|
|
|
<el-form-item label="Pack NO."> |
|
|
|
|
|
<el-input :value="fifoCurrentLabel.seqNo || ''" readonly></el-input> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item label="产品编码"> |
|
|
|
|
|
<el-input :value="fifoCurrentLabel.partNo || ''" readonly></el-input> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item label="标签日期"> |
|
|
|
|
|
<el-input :value="getFifoCurrentLabelDate()" readonly></el-input> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item label="数量"> |
|
|
|
|
|
<el-input :value="fifoCurrentLabel.printQty || ''" readonly></el-input> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-form> |
|
|
|
|
|
</el-card> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
</el-row> |
|
|
|
|
|
<span slot="footer" class="dialog-footer" style="text-align: center"> |
|
|
|
|
|
<el-button type="primary" @click="fifoDialogVisible = false">关闭</el-button> |
|
|
|
|
|
</span> |
|
|
|
|
|
</el-dialog> |
|
|
<div style="height: 20px"></div> |
|
|
<div style="height: 20px"></div> |
|
|
</el-dialog> |
|
|
</el-dialog> |
|
|
</div> |
|
|
</div> |
|
|
|