常熟吴彦祖 3 weeks ago
parent
commit
45e7099027
  1. 168
      src/views/modules/production/scanForm.vue
  2. 5
      src/views/modules/production/shippingScan.vue

168
src/views/modules/production/scanForm.vue

@ -1,5 +1,11 @@
<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 {Decimal} from "decimal.js";
import {getPhotoAddressData} from "../../../api/pad";
@ -91,6 +97,13 @@ export default {
"扫描时间": "createData",
},
exportName: "发货扫描"+dayjs().format("YYYYMMDDHHmmss"),
fifoDialogVisible:false,
fifoLoading:false,
fifoQuery:{
label:''
},
fifoList:[],
fifoCurrentLabel:{}
}
},
methods:{
@ -126,6 +139,98 @@ export default {
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(){
let paramsScan={
site:this.detail.site,
@ -219,6 +324,10 @@ export default {
label: '',
flag: '',
}
this.fifoDialogVisible = false
this.fifoQuery.label = ''
this.fifoList = []
this.fifoCurrentLabel = {}
if (this.isReport === false && this.total < this.notifyQty){
this.$message.warning("扫描数量未达到通知单数量")
// this.$alert("", '', {
@ -255,6 +364,13 @@ export default {
changePhoto(index){
this.num=index+1;
}
},
watch:{
fifoDialogVisible(newVal){
if (newVal){
this.focusFifoScanInput()
}
}
}
}
@ -292,6 +408,9 @@ export default {
<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-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">
<download-excel
:fields="exportDataStandard"
@ -364,6 +483,53 @@ export default {
</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>
</el-dialog>
</div>

5
src/views/modules/production/shippingScan.vue

@ -948,12 +948,13 @@ export default {
<el-button @click="boxLabelVisible = false">取消</el-button>
</span>
</el-dialog>
<el-dialog :visible.sync="fifoDialogVisible" v-drag :close-on-click-modal="false" title="查询先进先出" width="1300px">
<!-- 独立挂载并关闭即销毁避免多次开关后遮罩叠层 - rqrq -->
<el-dialog :visible.sync="fifoDialogVisible" v-drag :close-on-click-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-input ref="fifoScanInput" v-model="fifoQuery.label" clearable @submit.native.prevent @keyup.enter.native="queryFifoListByLabel"></el-input>
</el-form-item>
<el-form-item label=" ">
<el-button type="primary" :loading="fifoLoading" @click="queryFifoListByLabel">查询</el-button>

Loading…
Cancel
Save