Commit 7621ad78 authored by hubaoshan's avatar hubaoshan

pd

parent f3f9026a
......@@ -28,7 +28,6 @@ export function getIncomeWmsBox(businessId) {
})
}
// 3. 新增库存管理
export function addIncomeWmsBox(data) {
data = Qs.stringify(data)
......
import request from '@/utils/request'
import Qs from 'qs'
/**
* 1. 列表查询
* 2. 查询详细信息
* 3. 新增
* 4. 修改
* 5. 逻辑删除
* 6. 导出
*
*/
// 1. 查询库存管理列表
export function listIncomeWmsBoxPd(query) {
return request({
url: '/incomewmsboxpd/list',
method: 'get',
params: query
})
}
// 2. 查询库存管理详细信息
export function getIncomeWmsBoxPd(businessId) {
return request({
url: '/incomewmsboxpd/detail/' + businessId,
method: 'get'
})
}
// 3. 新增库存管理
export function addIncomeWmsBoxPd(data) {
data = Qs.stringify(data)
return request({
url: '/incomewmsboxpd/add',
method: 'post',
data: data
})
}
// 4. 修改库存管理
export function updateIncomeWmsBoxPd(data) {
const businessId = data.businessId
data = Qs.stringify(data)
return request({
url: '/incomewmsboxpd/updatepd/' + businessId,
method: 'put',
data
})
}
// 5. 逻辑删除库存管理
export function delIncomeWmsBoxPd(businessId) {
return request({
url: '/incomewmsboxpd/deleteLogical/' + businessId,
method: 'delete'
})
}
// 6. 导出库存管理
export function exportIncomeWmsBoxPd(query) {
return request({
url: '/incomewmsboxpd/export',
method: 'get',
params: query,
responseType: 'blob'
})
}
// 7.获取单号
export function getJcCode() {
return request({
url: '/incomewmsboxpd/getJcCode',
method: 'get'
})
}
// 8. 查询满足条件的条数
export function queryPass(lot) {
return request({
url: '/incomewmsboxpd/queryPass/' + lot,
method: 'get'
})
}
// 9. 批量新增库存管理
export function batchAddIncomeWmsBoxPd(data) {
return request({
url: '/incomewmsboxpd/batchAdd',
method: 'post',
data: data,
headers: {
'Content-Type': 'application/json;charset=UTF-8' // 接口修改传参类型
}
})
}
export function checkIsZero(data) {
return request({
url: 'incomewmsboxpd/checkIsZero',
method: 'post',
data,
headers: {
'Content-Type': 'application/json;charset=UTF-8' // 接口修改传参类型
}
})
}
......@@ -4,7 +4,7 @@ import { getInfo } from '@/api/login'
import Layout from '@/layout/index'
// pathList: 是要隐藏菜单的集合 system元素:一级菜单的路径(path)
const pathList = ['system', 'system/log', 'production', 'equipment', 'process', '/none2', 'sample', 'tlias', '/test', '/inspect', '/controlPlatform/control', '/template/planeGraph', '/demoData/demoData1']
const pathList = ['system', 'system/log', 'production', 'equipment', 'process', '/none2', 'sample', 'tlias', '/test', '/inspect', '/controlPlatform/control', '/template/planeGraph', '/demoData/demoData1','/setup/test']
const permission = {
state: {
......
......@@ -211,6 +211,6 @@ export function successAudio(start) {
// 自定义转换成大写的
export function customUpperCase(sourceStr) {
return sourceStr && sourceStr !== ''? sourceStr.toUpperCase(): sourceStr
return sourceStr && sourceStr !== '' ? sourceStr.toUpperCase() : sourceStr
}
<template>
<div class="dispose-module">
<div class="search">
<el-form @submit.native.prevent ref="searchRef" :model="form" :rules="rules" label-width="80px" class="formClass" label-position="right">
<el-form ref="searchRef" :model="form" :rules="rules" label-width="80px" class="formClass" label-position="right" @submit.native.prevent>
<div class="searchDiv">
<el-form-item label="ptype:">
<!-- <span>{{ form.ptype && getDictLabelByValue(typeList, form.ptype.trim()) || '-' }}</span>-->
......@@ -20,7 +20,7 @@
<el-form-item label="lot:">
<span>{{ form.lot || '-' }}</span>
</el-form-item>
<el-form-item v-if="form.cj && form.cj !== null" label="cj:">
<el-form-item v-if="form.cj && form.cj !== null" label="cj:">
<span>{{ getLabelByCj(form.cj) || '-' }}</span>
</el-form-item>
</div>
......@@ -28,7 +28,7 @@
<el-form-item label="qty:">
<span>{{ form.qty || '-' }}</span>
</el-form-item>
<el-form-item label="rank:">
<el-form-item label="rank:">
<span>{{ form.rank || '-' }}</span>
</el-form-item>
</div>
......@@ -37,7 +37,7 @@
<hr class="disposeHr">
<div class="disposeTable">
<div class="searchInput">
<el-form @submit.native.prevent ref="formRef" :model="searchForm" :rules="rules" label-width="80px" class="formClass" label-position="right">
<el-form ref="formRef" :model="searchForm" :rules="rules" label-width="80px" class="formClass" label-position="right" @submit.native.prevent>
<el-form-item label="位置" prop="search">
<el-input ref="input1" v-model="searchForm.search" clearable @keyup.enter.native="handleSearch" />
</el-form-item>
......@@ -77,9 +77,9 @@
</template>
<script>
import manufacturer from "@/data/jsonData";
import manufacturer from '@/data/jsonData'
import { handleOutWarehouse, persistOut } from '@/api/outcomeWmsJbapplyTemp'
import {customUpperCase} from "@/utils/common";
import { customUpperCase } from '@/utils/common'
import { playAudio, successAudio } from '@/utils/common'
export default {
......@@ -109,7 +109,7 @@ export default {
lot: null,
qty: null,
rank: null,
cj: null,
cj: null
},
rules: {
......@@ -187,7 +187,7 @@ export default {
var list = []
// 判断tableList中location和search及lot相同的元素个数
this.tableList.forEach((item, index) => {
if (customUpperCase(item.location) === customUpperCase(search) && customUpperCase(item.lot)=== customUpperCase(lot)) {
if (customUpperCase(item.location) === customUpperCase(search) && customUpperCase(item.lot) === customUpperCase(lot)) {
list.push(index)
}
})
......@@ -201,7 +201,7 @@ export default {
if (list.length > 1) {
// 是否能从储存中找到location
if (this.storeList.find(Litem => customUpperCase(Litem.location) === customUpperCase(search) && customUpperCase(Litem.lot) === customUpperCase(lot))) {
var index = this.storeList.findIndex(Litem => customUpperCase(Litem.location)=== customUpperCase(search)&& customUpperCase(Litem.lot)=== customUpperCase(lot))
var index = this.storeList.findIndex(Litem => customUpperCase(Litem.location) === customUpperCase(search) && customUpperCase(Litem.lot) === customUpperCase(lot))
this.storeList[index].frequency = this.storeList[index].frequency + 1
if (this.storeList[index].frequency < this.storeList[index].list.length) {
last.index = this.storeList[index].list[this.storeList[index].frequency]
......@@ -257,7 +257,7 @@ export default {
if (lot && lot !== '') {
twoLot = customUpperCase(lot)
}
if (customUpperCase(item.location) === customUpperCase(search) && oneLot === twoLot) {
if (customUpperCase(item.location) === customUpperCase(search) && oneLot === twoLot) {
obj.list.push(index)
}
})
......@@ -366,7 +366,7 @@ export default {
}
/** ptyp为1的时候*/
if (this.form.ptype === '1') {
if (customUpperCase(obj.pn) !== customUpperCase(this.form.pn) || customUpperCase(obj.lot) !== customUpperCase(this.form.lot)|| customUpperCase(obj.rank) !== customUpperCase(this.form.rank)) {
if (customUpperCase(obj.pn) !== customUpperCase(this.form.pn) || customUpperCase(obj.lot) !== customUpperCase(this.form.lot) || customUpperCase(obj.rank) !== customUpperCase(this.form.rank)) {
playAudio(true)
this.$message.error({
message: '输入不符合要求请重新输入!',
......
......@@ -2,7 +2,14 @@
<div class="enterBound">
<div class="enterForm">
<div class="search">
<el-form ref="queryForm" class="formClass" :model="queryForm" :rules="rules" label-width="80px" @submit.native.prevent>
<el-form
ref="queryForm"
class="formClass"
:model="queryForm"
:rules="rules"
label-width="80px"
@submit.native.prevent
>
<el-form-item label="仓库:" prop="whId">
<el-select v-model="queryForm.whId" filterable class="normalSelect" placeholder="请选择">
<el-option
......@@ -28,7 +35,13 @@
</el-select>
</el-form-item>
<el-form-item label="XX:" prop="value1">
<el-input ref="input1" v-model="queryForm.value1" :disabled="enterTable.length>0" clearable @keyup.enter.native="handelTab(1,$event)" />
<el-input
ref="input1"
v-model="queryForm.value1"
:disabled="enterTable.length>0"
clearable
@keyup.enter.native="handelTab(1,$event)"
/>
</el-form-item>
<el-form-item>
<div class="location"> location: {{ queryForm.location }}</div>
......@@ -66,7 +79,11 @@
</el-table-column>
<el-table-column min-width="20" :show-overflow-tooltip="true">
<template slot-scope="scope">
<i class="el-icon-delete-solid" style="font-size: 26px;margin-left: -10px;color: #46BCF3; margin-top: 7px" @click="handleDelte(scope.$index)" />
<i
class="el-icon-delete-solid"
style="font-size: 26px;margin-left: -10px;color: #46BCF3; margin-top: 7px"
@click="handleDelte(scope.$index)"
/>
<!-- <span>{{scope.row.value3}}</span>-->
</template>
</el-table-column>
......@@ -90,15 +107,15 @@
</template>
<script>
import manufacturer from "@/data/jsonData";
import {
import manufacturer from '@/data/jsonData'
import {
batchAddIncomeWmsBox, checkIsZero, getJcCode
} from '@/api/incomeWmsBox'
import { findByLocation } from '@/api/incomeWmsLabel'
import { getInfo } from '@/api/login'
import { getDict } from '@/api/system/dict/data'
import { playAudio, successAudio } from '@/utils/common'
import {customUpperCase} from "@/utils/common";
import { customUpperCase } from '@/utils/common'
export default {
name: 'EnterBound',
data() {
......@@ -236,7 +253,6 @@ export default {
if (valid && this.enterTable.length > 0) {
const obj = {
boxList: this.enterTable
}
batchAddIncomeWmsBox(obj).then(res => {
console.log('res', res)
......@@ -459,7 +475,7 @@ export default {
// this.incomeWmsBoxList.pn = values[1]
if (obj.labelId !== null && obj.labelId !== '' && obj.labelId !== undefined) {
if (this.incomeWmsLabelList.pn && this.incomeWmsLabelList.pn !== '' && this.incomeWmsLabelList.pn !== undefined) {
if (customUpperCase(obj.pn)!== customUpperCase(this.incomeWmsLabelList.pn)) {
if (customUpperCase(obj.pn) !== customUpperCase(this.incomeWmsLabelList.pn)) {
playAudio(true)
this.$message.error({
message: '输入的pn值:' + obj.pn + '与数据库中pn值:' + this.incomeWmsLabelList.pn + '不匹配,请重新输入',
......@@ -473,7 +489,7 @@ export default {
} else {
let isLegalLot = false
this.enterTable.forEach(item => {
if (customUpperCase(item.lot) === customUpperCase(obj.lot) ) {
if (customUpperCase(item.lot) === customUpperCase(obj.lot)) {
isLegalLot = true
}
})
......@@ -550,7 +566,7 @@ export default {
if (res.data != null) {
let isLegalLot = false
this.enterTable.forEach(item => {
if (customUpperCase(item.lot) === customUpperCase(obj.lot) ) {
if (customUpperCase(item.lot) === customUpperCase(obj.lot)) {
isLegalLot = true
}
})
......@@ -579,7 +595,7 @@ export default {
if (res.code === 200) {
if (res.data) {
if (this.enterTable.length > 0) {
if (customUpperCase(this.enterTable[0].pn) === customUpperCase(obj.pn) ) {
if (customUpperCase(this.enterTable[0].pn) === customUpperCase(obj.pn)) {
successAudio(true)
this.enterTable.push(obj)
this.incomeWmsBoxList.pn = obj.pn
......
<template>
<div class="enterBound">
<div class="enterForm">
<div class="search">
<el-form
ref="queryForm"
class="formClass"
:model="queryForm"
:rules="rules"
label-width="80px"
@submit.native.prevent
>
<el-form-item label="仓库:" prop="whId">
<el-select v-model="queryForm.whId" filterable class="normalSelect" placeholder="请选择">
<el-option
v-for="(item,index) in warehouseList"
:key="index"
:label="item.dictLabel"
:value="item.dictValue"
/>
</el-select>
</el-form-item>
<el-form-item label="cj" prop="cj">
<el-select
v-model="queryForm.cj"
class="normalSelect"
placeholder="请选择厂家"
>
<el-option
v-for="item in manufacturer"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="XX:" prop="value1">
<el-input
ref="input1"
v-model="queryForm.value1"
:disabled="enterTable.length>0"
clearable
@keyup.enter.native="handelTab(1,$event)"
/>
</el-form-item>
<el-form-item>
<div class="location"> location: {{ queryForm.location }}</div>
<div v-show="showPN(queryForm.location,incomeWmsLabelList.pn)">
<!-- 库PN: {{ incomeWmsLabelList.pn }}-->
<span style="color: black;">库PN: </span><span style="color: red;">{{ incomeWmsLabelList.pn }}</span>
</div>
</el-form-item>
<el-form-item label="YY:" prop="value2">
<el-input ref="input2" v-model="queryForm.value2" clearable @keyup.enter.native="addList" />
</el-form-item>
<el-form-item>
<div class="showPn">
<span class="pnFont">YYpn: {{ incomeWmsBoxList.pn }}</span>
</div>
</el-form-item>
</el-form>
</div>
<div class="enterTable">
<el-table :data="enterTable">
<el-table-column label="lot" min-width="52" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{ scope.row.lot }}</span>
</template>
</el-table-column>
<el-table-column label="qty" min-width="52" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{ scope.row.qty }}</span>
</template>
</el-table-column>
<el-table-column label="rank" min-width="52" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{ scope.row.rank }}</span>
</template>
</el-table-column>
<el-table-column min-width="20" :show-overflow-tooltip="true">
<template slot-scope="scope">
<i
class="el-icon-delete-solid"
style="font-size: 26px;margin-left: -10px;color: #46BCF3; margin-top: 7px"
@click="handleDelte(scope.$index)"
/>
<!-- <span>{{scope.row.value3}}</span>-->
</template>
</el-table-column>
</el-table>
</div>
<div class="tableTotal">
<span style="color: red">条数:{{ enterTable.length }}</span>
</div>
<div class="buttonRegion">
<el-button class="button_rowBtn" type="primary" @click="SubmitForm">保存</el-button>
<el-button class="button_rowBtn" type="primary" @click="clearFormConfirmation($event)">清空</el-button>
</div>
<!-- 中间文本-->
<div class="BottomContent">
<div class="fontSp">单号: {{ incomeWmsBoxList.order_code }}</div>
<div class="loginUser">操作人: {{ userList.nickName }} </div>
</div>
</div>
</div>
</template>
<script>
import manufacturer from '@/data/jsonData'
import {
batchAddIncomeWmsBox, checkIsZero, getJcCode
} from '@/api/incomeWmsBox'
import { findByLocation } from '@/api/incomeWmsLabel'
import { getInfo } from '@/api/login'
import { getDict } from '@/api/system/dict/data'
import { playAudio, successAudio } from '@/utils/common'
import { customUpperCase } from '@/utils/common'
import {batchAddIncomeWmsBoxPd} from "@/api/incomeWmsBoxPd";
export default {
name: 'EnterboundPd',
data() {
return {
queryForm: {
cj: '',
whId: '',
location: '', // 假设 location 的值为 'A1'
pn: '', // 假设 pn 的值为 'ABC'
value1: '',
value2: '',
lot: '',
qty: '',
rank: ''
},
// 库存管理表格数据
incomeWmsBoxList: {
order_code: '',
pn: ''
},
// 仓库数据
warehouseList: [],
form: {},
enterTable: [],
incomeWmsLabelList: {},
userList: {
nickName: ''
},
manufacturer: {},
// 表单校验
rules: {
value1: [
{ required: true, message: '请输入barcode的值', trigger: 'blur' },
{ pattern: /^.*,.*/ | /^.*$/, message: '输入值不符合格式要求,请重新输入', trigger: 'blur' }
],
value2: [
{ pattern: /^[^:]+:[^:]+:[^:]+:\d+$/, message: '输入值不符合格式要求,请重新输入', trigger: 'blur' }
]
}
}
},
created() {
console.log('manufacturer', manufacturer)
this.manufacturer = manufacturer
this.getDictData()
this.focusing()
this.getOrderCode()
this.getLoginUser()
// this.queryForm.cj = this.manufacturer[0].value
},
mounted() {
this.queryForm.cj = this.manufacturer[0].value
},
methods: {
customUpperCase,
/**
* @description: 获取数据字典
* @author: gaoyu
* @param:
* @return:
**/
getDictData() {
// 获取仓库的数据字段
getDict('WAREHOUSE').then(res => {
console.log('仓库数据字典', res)
this.warehouseList = res.data
const whId = res.data[0].dictValue
this.queryForm.whId = whId
})
},
showPN(location, pn) {
if ((location !== '' && location !== null) && (pn !== '' && pn !== null && pn !== undefined)) {
return true
} else {
return false
}
},
/**
* 清空按钮
* @param e
*/
// 清空按钮的确认逻辑
clearFormConfirmation(e) {
if (e.target.innerText === '清空') {
this.$confirm('确定要清空列表吗?', '清空列表', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.clearForm(e)
this.getDictData()
this.queryForm.cj = this.manufacturer[0].value
this.$message({
type: 'success',
message: '清空成功!'
})
}).catch(() => {
})
}
},
clearForm(e) {
this.queryForm = {
queryForm: {
cj: '',
location: '', // 假设 location 的值为 'A1'
pn: '', // 假设 pn 的值为 'ABC'
value1: '',
value2: '',
lot: '',
qty: '',
rank: ''
}
}
this.incomeWmsLabelList = {}
this.incomeWmsBoxList.pn = ''
this.enterTable = []
const that = this
that.$nextTick(() => {
e.target.blur()
that.$refs['input1'].focus()
})
},
/**
* 保存
*/
SubmitForm() {
this.$confirm('确定要执行新增操作吗?', '批量新增', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$refs.queryForm.validate(valid => {
if (valid && this.enterTable.length > 0) {
const obj = {
boxList: this.enterTable
}
batchAddIncomeWmsBoxPd(obj).then(res => {
console.log('res', res)
if (res.code === 200) {
this.msgSuccess('新增成功')
this.clearForm()
this.queryForm.cj = this.manufacturer[0].value
this.getDictData()
this.getOrderCode()
this.$nextTick().then(() => {
this.$refs.input1.focus()
})
}
})
} else {
this.$message.error('列表的数据不能为空')
}
})
}).catch(() => {
})
},
/** 获取当前登录用户**/
getLoginUser() {
getInfo().then(response => {
if (response.code === 200) {
this.userList.nickName = response.data.user.nickName
}
})
},
/**
* 获取单号
*/
// 获取单号
getOrderCode() {
getJcCode().then(response => {
if (response.code === 200) {
this.incomeWmsBoxList.order_code = response.data
}
})
},
/**
* @description: 监听输入框回车事件,如果回车焦点聚集到下一个输入框
* @author: gaoyu
* @param:
* @return:
**/
handelTab(i, e) {
const that = this
if (!that.$refs['input' + i]) {
return
}
this.$refs.queryForm.validateField('value1', (error) => {
if (error) {
playAudio(true)
this.$message.error({
message: '输入值不符合格式要求,请重新输入',
duration: 2000,
onClose: () => {
playAudio(false)
}
}, () => {})
} else {
const inputValues = this.queryForm.value1.split(',')
if (inputValues.length === 2) {
this.queryForm.location = inputValues[0].trim()
this.queryForm.pn = inputValues[1].trim()
findByLocation(this.queryForm.location).then(res => {
if (res.code === 200) {
if (res.data != null) {
if (res.data.pn !== null && res.data.pn !== '') {
this.incomeWmsLabelList = res.data
// this.getOrderCode()
successAudio(true)
that.$nextTick(() => {
e.target.blur()
const index = i + 1
that.$refs['input' + index].focus()
})
} else {
successAudio(true)
this.incomeWmsLabelList = res.data
that.$nextTick(() => {
e.target.blur()
const index = i + 1
that.$refs['input' + index].focus()
})
}
} else {
playAudio(true)
this.$message.error({
message: '数据库中无对应数据location:' + this.queryForm.location,
duration: 2000,
onClose: () => {
playAudio(false)
}
}, () => {
})
this.queryForm.value1 = ''
this.queryForm.location = ''
this.incomeWmsLabelList.pn = ''
this.queryForm.value2 = ''
}
}
})
} else {
console.log('查询2')
if (inputValues.length === 1) {
this.queryForm.location = inputValues[0].trim()
console.log('location', this.queryForm.location)
findByLocation(this.queryForm.location).then(res => {
if (res.code === 200) {
console.log('resDate', res.data)
if (res.data != null) {
if (res.data.pn !== null && res.data.pn !== '') {
if (res.data.pn !== this.queryForm.pn) {
successAudio(true)
this.incomeWmsLabelList = res.data
that.$nextTick(() => {
e.target.blur()
const index = i + 1
that.$refs['input' + index].focus()
})
} else {
successAudio(true)
this.incomeWmsLabelList = res.data
// this.getOrderCode()
that.$nextTick(() => {
e.target.blur()
const index = i + 1
that.$refs['input' + index].focus()
})
}
} else {
successAudio(true)
this.incomeWmsLabelList = res.data
that.$nextTick(() => {
e.target.blur()
const index = i + 1
that.$refs['input' + index].focus()
})
}
} else {
playAudio(true)
this.$message.error({
message: '数据库中无对应数据location:' + this.queryForm.location,
duration: 2000,
onClose: () => {
playAudio(false)
}
})
this.queryForm.value1 = ''
this.queryForm.location = ''
this.incomeWmsLabelList.pn = ''
this.queryForm.value2 = ''
}
}
})
} else {
playAudio(true)
// 输入值不符合格式要求,进行报错处理
this.$message.error({
message: '输入值不符合格式要求,请重新输入',
duration: 2000,
onClose: () => {
playAudio(false)
}
})
this.queryForm.value1 = ''
}
}
}
})
},
/**
* @description: 一开始将焦点聚焦到第一个输入框下
* @author: gaoyu
* @param:
* @return:
**/
focusing() {
this.$nextTick().then(() => {
this.$refs.input1.focus()
})
},
/**
* @description: 监听第二个输入框,回车将输入添加到数组中
* @author: gaoyu
* @param:
* @return:
**/
addList() {
this.$refs.queryForm.validateField('value2', (error) => {
if (error) {
playAudio(true)
this.$message.error({
message: '输入值不符合格式要求,请重新输入',
duration: 2000,
onClose: () => {
playAudio(false)
}
})
this.queryForm.value2 = ''
} else {
const values = this.queryForm.value2.split(':')
// 校验第三个值是否为整数
// 校验第三个值是否为整数
// if (/^\d+$/.test(values[3])) {
const obj = {
whId: this.queryForm.whId,
lot: values[0],
cj: this.queryForm.cj,
location: this.queryForm.location,
pn: values[1],
qty: parseInt(values[3]),
rank: values[2],
labelId: this.incomeWmsLabelList.businessId,
orderCode: this.incomeWmsBoxList.order_code
}
// this.incomeWmsBoxList.pn = values[1]
if (obj.labelId !== null && obj.labelId !== '' && obj.labelId !== undefined) {
if (this.incomeWmsLabelList.pn && this.incomeWmsLabelList.pn !== '' && this.incomeWmsLabelList.pn !== undefined) {
if (customUpperCase(obj.pn) !== customUpperCase(this.incomeWmsLabelList.pn)) {
playAudio(true)
this.$message.error({
message: '输入的pn值:' + obj.pn + '与数据库中pn值:' + this.incomeWmsLabelList.pn + '不匹配,请重新输入',
duration: 2000,
onClose: () => {
playAudio(false)
}
})
this.queryForm.value2 = null
// this.incomeWmsBoxList.pn = obj.pn
} else {
let isLegalLot = false
this.enterTable.forEach(item => {
if (customUpperCase(item.lot) === customUpperCase(obj.lot)) {
isLegalLot = true
}
})
if (isLegalLot) {
if (customUpperCase(this.enterTable[0].pn) === customUpperCase(obj.pn)) {
successAudio(true)
this.enterTable.push(obj)
this.incomeWmsBoxList.pn = obj.pn
this.queryForm.value2 = ''
} else {
playAudio(true)
this.$message.error({
message: '与下方列表的pn:' + this.enterTable[0].pn + '不匹配',
duration: 2000,
onClose: () => {
playAudio(false)
}
})
this.queryForm.value2 = null
}
} else {
const Zbj = {
lot: obj.lot
}
checkIsZero(Zbj).then(res => {
if (res.code === 200) {
if (res.data) {
if (this.enterTable.length > 0) {
if (customUpperCase(this.enterTable[0].pn) === customUpperCase(obj.pn)) {
successAudio(true)
this.enterTable.push(obj)
this.incomeWmsBoxList.pn = obj.pn
this.queryForm.value2 = ''
} else {
playAudio(true)
this.$message.error({
message: '与下方列表的pn:' + this.enterTable[0].pn + '不匹配',
duration: 2000,
onClose: () => {
playAudio(false)
}
})
this.queryForm.value2 = null
}
} else {
successAudio(true)
this.enterTable.push(obj)
this.incomeWmsBoxList.pn = obj.pn
this.queryForm.value2 = ''
}
} else {
// 创建一个新的音频元素
playAudio(true)
this.$message.error({
message: '该LOT值' + obj.lot + '未被检查!',
duration: 2000,
onClose: () => {
// 当消息提示框关闭时停止播放声音
playAudio(false)
}
}, () => {
})
this.queryForm.value2 = null
}
}
})
}
}
} else {
const inputValues = this.queryForm.value1.split(',')
this.queryForm.location = inputValues[0].trim()
findByLocation(this.queryForm.location).then(res => {
if (res.code === 200) {
if (res.data != null) {
let isLegalLot = false
this.enterTable.forEach(item => {
if (customUpperCase(item.lot) === customUpperCase(obj.lot)) {
isLegalLot = true
}
})
if (isLegalLot) {
if (customUpperCase(this.enterTable[0].pn) === customUpperCase(obj.pn)) {
successAudio(true)
this.enterTable.push(obj)
this.incomeWmsBoxList.pn = obj.pn
this.queryForm.value2 = ''
} else {
playAudio(true)
this.$message.error({
message: '与下方列表的pn值' + this.enterTable[0].pn + '不匹配',
duration: 2000,
onClose: () => {
playAudio(false)
}
})
this.queryForm.value2 = null
}
} else {
const Zbj = {
lot: obj.lot
}
checkIsZero(Zbj).then(res => {
if (res.code === 200) {
if (res.data) {
if (this.enterTable.length > 0) {
if (customUpperCase(this.enterTable[0].pn) === customUpperCase(obj.pn)) {
successAudio(true)
this.enterTable.push(obj)
this.incomeWmsBoxList.pn = obj.pn
this.queryForm.value2 = ''
} else {
playAudio(true)
this.$message.error({
message: '与下方列表的pn值' + this.enterTable[0].pn + '不匹配',
duration: 2000,
onClose: () => {
playAudio(false)
}
})
this.queryForm.value2 = null
}
} else {
successAudio(true)
this.enterTable.push(obj)
this.incomeWmsBoxList.pn = obj.pn
this.queryForm.value2 = ''
}
} else {
playAudio(true)
this.$message.error({
message: '该LOT值' + obj.lot + '未被检查!',
duration: 2000,
onClose: () => {
// 当消息提示框关闭时停止播放声音
playAudio(false)
}
}, () => {
})
this.queryForm.value2 = null
}
}
})
}
} else {
playAudio(true)
this.$message.error({
message: '该location的值' + this.queryForm.location + '无效' + '请输入有效的location值',
duration: 2000,
onClose: () => {
playAudio(false)
}
})
this.queryForm.location = ''
}
}
})
}
} else {
playAudio(true)
this.$message.error({
message: '输入格式不符合要求,请重新输入',
duration: 2000,
onClose: () => {
playAudio(false)
}
})
}
// }
// else {
// this.$message.error('qty的值必须为整数!')
// }
}
})
},
/**
* @description: 删除数据中元素
* @author: gaoyu
* @param:
* @return:
**/
handleDelte(index) {
this.enterTable.splice(index, 1)
}
}
}
</script>
<style scoped lang="scss">
.enterBound{
display: flex;
justify-content: center;
.enterForm{
width: 96%;
.normalSelect{
width: 100%;
}
//.input1Font{
// width: 100%;
// justify-content: space-between;
// display: flex;
//}
.showPn{
width: 100%;
justify-content: space-between;
display: flex;
}
.tableTotal{
margin-top: 2%;
}
}
.buttonRegion{
margin-top: 20px;
display: flex;
justify-content: space-between;
.button_rowBtn{
font-size: 17px;
width: 120px;
}
}
.BottomContent{
margin-top: 5%;
display: flex;
justify-content: space-between;
.loginUser{
text-align: right;
margin-right: 0.7%;
}
}
}
</style>
......@@ -2,7 +2,7 @@
<div class="enterboundTwo">
<div class="enterForm">
<div class="search">
<el-form @submit.native.prevent ref="from" :model="form" :rules="rules" label-width="80px" class="formClass" label-position="right">
<el-form ref="from" :model="form" :rules="rules" label-width="80px" class="formClass" label-position="right" @submit.native.prevent>
<el-form-item label="仓库:" prop="whId">
<el-select v-model="form.whId" filterable class="normalSelect" placeholder="请选择">
<el-option
......@@ -56,7 +56,7 @@ import { getDict } from '@/api/system/dict/data'
import { addIncomeWmsBox, getJcCode } from '@/api/incomeWmsBox'
import { findByLocation } from '@/api/incomeWmsLabel'
import { queryByPnAndType } from '@/api/income_mat_baseinfo'
import {playAudio, successAudio} from '@/utils/common'
import { playAudio, successAudio } from '@/utils/common'
export default {
name: 'EnterboundTwo',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment