Commit edd0bf66 authored by Hagsn3's avatar Hagsn3

修改

parent 9d0acf99
...@@ -86,3 +86,14 @@ export function handleOutWarehouse(query) { ...@@ -86,3 +86,14 @@ export function handleOutWarehouse(query) {
params: query params: query
}) })
} }
// 出库
export function persistOut(data) {
return request({
url: '/outcomewmsjbapplytemp/persistOut',
method: 'post',
data,
headers: {
'Content-Type': 'application/json;charset=UTF-8' // 接口修改传参类型
}
})
}
...@@ -184,7 +184,8 @@ export function includePermission(accessName) { ...@@ -184,7 +184,8 @@ export function includePermission(accessName) {
} }
// 控制音频启用状态 // 控制音频启用状态
export const isAudioAble = true const isAudioAble = false
const isSuccessAudioAble = false
const errorSound = new Audio(require('../assets/audio/y1840.mp3')) const errorSound = new Audio(require('../assets/audio/y1840.mp3'))
const successSound = new Audio(require('../assets/audio/8858.mp3')) const successSound = new Audio(require('../assets/audio/8858.mp3'))
export function playAudio(start) { export function playAudio(start) {
...@@ -192,18 +193,19 @@ export function playAudio(start) { ...@@ -192,18 +193,19 @@ export function playAudio(start) {
return return
} }
if (start) { if (start) {
setTimeout(() => { errorSound.play()
errorSound.play()
}, 2000)
} else { } else {
errorSound.pause() // errorSound.pause()
} }
} }
export function successAudio(start) { export function successAudio(start) {
if (!isSuccessAudioAble) {
return
}
if (start) { if (start) {
successSound.play() successSound.play()
} else { } else {
successSound.pause() // successSound.pause()
} }
} }
...@@ -2,19 +2,27 @@ ...@@ -2,19 +2,27 @@
<div class="dispose-module"> <div class="dispose-module">
<div class="search"> <div class="search">
<el-form 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">
<el-form-item label="code:"> <div class="searchDiv">
<span>{{ form.appCode || '-' }}</span> <el-form-item label="ptype:">
</el-form-item> <span>{{ form.ptype && getDictLabelByValue(typeList, form.ptype.trim()) || '-' }}</span>
</el-form-item>
<el-form-item label="code:">
<span>{{ form.appCode || '-' }}</span>
</el-form-item>
</div>
<el-form-item label="pn:"> <el-form-item label="pn:">
<span>{{ form.pn || '-' }}</span> <span>{{ form.pn || '-' }}</span>
</el-form-item> </el-form-item>
<el-form-item label="lot:">
<span>{{ form.lot || '-' }}</span>
</el-form-item>
<div class="searchDiv"> <div class="searchDiv">
<el-form-item label="ptype:">
<span>{{ getDictLabelByValue(typeList,form.ptype) || '-' }}</span>
</el-form-item>
<el-form-item label="qty:"> <el-form-item label="qty:">
<span>{{ form.qty || '-' }}</span> <span>{{ form.qty || '-' }}</span>
</el-form-item> </el-form-item>
<el-form-item label="rank:">
<span>{{ form.rank || '-' }}</span>
</el-form-item>
</div> </div>
</el-form> </el-form>
</div> </div>
...@@ -25,8 +33,8 @@ ...@@ -25,8 +33,8 @@
<el-form-item label="位置"> <el-form-item label="位置">
<el-input ref="input1" v-model="searchForm.search" clearable @keyup.enter.native="handleSearch" /> <el-input ref="input1" v-model="searchForm.search" clearable @keyup.enter.native="handleSearch" />
</el-form-item> </el-form-item>
<el-form-item label="LOT"> <el-form-item label="YY">
<el-input ref="input2" v-model="searchForm.lot" clearable @keyup.enter.native="handleSearchLot" /> <el-input ref="input2" v-model="searchForm.value2" clearable @keyup.enter.native="handleSearchLot" />
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
...@@ -37,11 +45,11 @@ ...@@ -37,11 +45,11 @@
<span>{{ scope.row.location || '-' }}</span> <span>{{ scope.row.location || '-' }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="LOT"> <!-- <el-table-column label="LOT">-->
<template slot-scope="scope"> <!-- <template slot-scope="scope">-->
<span>{{ scope.row.lot || '-' }}</span> <!-- <span>{{ scope.row.lot || '-' }}</span>-->
</template> <!-- </template>-->
</el-table-column> <!-- </el-table-column>-->
<el-table-column label="数量"> <el-table-column label="数量">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.needNumber || '-' }}</span> <span>{{ scope.row.needNumber || '-' }}</span>
...@@ -61,9 +69,7 @@ ...@@ -61,9 +69,7 @@
</template> </template>
<script> <script>
import { handleOutWarehouse, persistOut } from '@/api/outcomeWmsJbapplyTemp'
import { persistOut } from '@/api/setup/applicationTable'
import { handleOutWarehouse } from '@/api/outcomeWmsJbapplyTemp'
import { getDict } from '@/api/system/dict/data' import { getDict } from '@/api/system/dict/data'
import { playAudio, successAudio } from '@/utils/common' import { playAudio, successAudio } from '@/utils/common'
...@@ -95,7 +101,9 @@ export default { ...@@ -95,7 +101,9 @@ export default {
tableList: [], tableList: [],
searchForm: { searchForm: {
search: '', search: '',
lot: '' lot: '',
value2: ''
} }
} }
}, },
...@@ -120,7 +128,7 @@ export default { ...@@ -120,7 +128,7 @@ export default {
getAllDict() { getAllDict() {
getDict('APPLICATION_TYPE').then(res => { getDict('APPLICATION_TYPE').then(res => {
if (res.code === 200) { if (res.code === 200) {
console.log('res', res) console.log('res的得的', res)
this.typeList = res.data this.typeList = res.data
} }
}) })
...@@ -278,6 +286,15 @@ export default { ...@@ -278,6 +286,15 @@ export default {
} else { } else {
this.search = this.searchForm.search this.search = this.searchForm.search
} }
} else {
playAudio(true)
this.$message.error({
message: '输入的格式不符合要求,请重新输入',
duration: 2000,
onClose: () => {
playAudio(false)
}
})
} }
console.log('this.search', this.search) console.log('this.search', this.search)
if (this.search != null) { if (this.search != null) {
...@@ -287,28 +304,76 @@ export default { ...@@ -287,28 +304,76 @@ export default {
} }
}, },
handleSearchLot() { handleSearchLot() {
// 获取LOT输入框的数据 const pattern = /^[^:]+:[^:]+:[^:]+:\d+$/
if (this.searchForm.lot && this.searchForm.lot !== '') { const inputLot = this.searchForm.value2.trim()
this.lot = this.searchForm.lot if (!pattern.test(inputLot)) {
} playAudio(true)
if (this.search && this.lot) { this.$message.error({
var lot = this.lot message: '输入格式不正确,请按照指定格式输入!',
var search = this.search duration: 3000,
// 调用方法,并传入位置和LOT作为参数 onClose: () => {
const obj = this.getIndexAndNeedNumber(search, lot) playAudio(false)
}
})
// 清空输入框
this.searchForm.value2 = ''
// 或者保留原来的输入
// this.$refs.input2.$refs.input.value = '';
} else {
const values = this.searchForm.value2.split(':')
const obj = {
lot: values[0],
pn: values[1],
qty: parseInt(values[3]),
rank: values[2]
}
console.log(obj)
if (obj.pn !== this.form.pn || obj.lot !== this.form.lot) {
playAudio(true)
this.$message.error({
message: '输入不符合要求请重新输入!',
duration: 2000,
onClose: () => {
playAudio(false)
}
})
this.searchForm.value2 = null
} else {
// 获取LOT输入框的数据
this.lot = obj.lot
if (this.search && this.lot) {
var lot = this.lot
var search = this.search
// 调用方法,并传入位置和LOT作为参数
const abj = this.getIndexAndNeedNumber(search, lot)
if (obj) { if (abj) {
const { index, needNumber } = obj const { index, needNumber } = abj
if (!this.rowIndexList.includes(index)) { if (!this.rowIndexList.includes(index)) {
successAudio(true) successAudio(true)
this.rowIndexList.push(index) this.rowIndexList.push(index)
this.search = null this.search = null
this.lot = null this.lot = null
}
this.total = this.total + needNumber
this.searchForm.search = ''
this.searchForm.value2 = '' // 清空LOT输入框数据
}
} else {
playAudio(true)
this.$message.error({
message: '输入不符合要求请重新输入!',
duration: 2000,
onClose: () => {
playAudio(false)
}
})
} }
this.total = this.total + needNumber
this.searchForm.search = ''
this.searchForm.lot = '' // 清空LOT输入框数据
} }
// if (this.searchForm.value2 && this.searchForm.value2 !== '') {
// this.lot = this.searchForm.value2
// }
} }
}, },
// 出库 // 出库
...@@ -335,7 +400,7 @@ export default { ...@@ -335,7 +400,7 @@ export default {
}) })
} else { } else {
this.$message.warning({ this.$message.warning({
message: '您所选择的库存数量' + this.form.qty + '小于您申请的数量' + this.total, message: '您申请的数量' + this.total + '您总的申请数量' + this.form.qty,
duration: 2000 duration: 2000
}) })
} }
......
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
<!-- 第一部分 --> <!-- 第一部分 -->
<div class="oneRegion"> <div class="oneRegion">
<div class="top"> <div class="top">
<div v-if="tabList[0].number == 0" class="oneButtion"> <div v-if="tabList[0].number ==0" class="oneButtion">
<div class="spanTest"> <div class="spanTest">
<div class="testContent">{{ tabList[0].label }}</div> <div class="testContent">JB</div>
</div> </div>
</div> </div>
<div v-if="tabList[0].number > 0" class="oneButtion"> <div v-if="tabList[0].number > 0" class="oneButtion">
...@@ -15,26 +15,26 @@ ...@@ -15,26 +15,26 @@
@click="handleToggle(tabList[0],0)" @click="handleToggle(tabList[0],0)"
> >
<div class="buttionText"> <div class="buttionText">
<span>{{ tabList[0].label }}</span> <span>JB</span>
<span style="color: red">({{ tabList[0].number }})</span> <span style="color: red">({{ tabList[0].number }})</span>
</div> </div>
</el-button> </el-button>
</div> </div>
<!-- <div v-if="tabList[1].number == 0" class="oneButtion">--> <div v-if="tabList[1].number == 0" class="oneButtion">
<!-- <div class="spanTest"><div class="testContent">{{ tabList[1].label }}</div></div>--> <div class="spanTest"><div class="testContent">JL</div></div>
<!-- </div>--> </div>
<!-- <div v-if="tabList[1].number > 0" class="oneButtion">--> <div v-if="tabList[1].number > 0" class="oneButtion">
<!-- <el-button--> <el-button
<!-- :class="actionIndex === 1 ? 'button_rowBtn_action' : 'button_rowBtn'"--> :class="actionIndex === 1 ? 'button_rowBtn_action' : 'button_rowBtn'"
<!-- type="primary"--> type="primary"
<!-- @click="handleToggle(tabList[1],1)"--> @click="handleToggle(tabList[1],1)"
<!-- >--> >
<!-- <div class="buttionText">--> <div class="buttionText">
<!-- <span>{{ tabList[1].label }}</span>--> <span>JL</span>
<!-- <span style="color: red">({{ tabList[1].number }})</span>--> <span style="color: red">({{ tabList[1].number }})</span>
<!-- </div>--> </div>
<!-- </el-button>--> </el-button>
<!-- </div>--> </div>
</div> </div>
<!-- <div class="top">--> <!-- <div class="top">-->
<!-- <div v-if="tabList[2].number == 0" class="oneButtion">--> <!-- <div v-if="tabList[2].number == 0" class="oneButtion">-->
...@@ -76,14 +76,25 @@ ...@@ -76,14 +76,25 @@
<!-- 第三部分--> <!-- 第三部分-->
<div class="threeTable"> <div class="threeTable">
<hr class="tableHr"> <hr class="tableHr">
<el-table :data="tableList"> <!-- style="margin-left: 50%; transform: translateX(-25%)"-->
<el-table-column type="index" label="序号" width="50" /> <el-table :data="tableList" >
<el-table-column label="pn"> <!-- <el-table-column type="index" label="序号" width="50" />-->
<el-table-column label="pn" width="95" >
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.pn || '-' }}</span> <span>{{ scope.row.pn || '-' }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="80"> <el-table-column label="lot" >
<template slot-scope="scope">
<span>{{ scope.row.lot || '-' }}</span>
</template>
</el-table-column>
<el-table-column label="qty" width="55">
<template slot-scope="scope">
<span>{{ scope.row.qty || '-' }}</span>
</template>
</el-table-column>
<el-table-column label="操作" width="50">
<template slot-scope="scope"> <template slot-scope="scope">
<span style="color: #46BCF3;cursor: pointer" @click="handleDispose(scope.row)">处理</span> <span style="color: #46BCF3;cursor: pointer" @click="handleDispose(scope.row)">处理</span>
</template> </template>
...@@ -284,8 +295,8 @@ export default { ...@@ -284,8 +295,8 @@ export default {
} }
} }
.threeTable{ .threeTable{
width: 92%; width: 99%;
margin: 4%; margin: 1%;
.tableHr{ .tableHr{
margin-bottom: 20px; margin-bottom: 20px;
} }
......
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