Commit db9093f1 authored by Hagsn3's avatar Hagsn3

提交代码

parent fe05d6c5
...@@ -3,16 +3,16 @@ ...@@ -3,16 +3,16 @@
<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:"> <el-form-item label="code:">
<span>{{form.appCode || '-'}}</span> <span>{{ form.appCode || '-' }}</span>
</el-form-item> </el-form-item>
<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="ptype:"> <el-form-item label="ptype:">
<span>{{form.ptype || '-'}}</span> <span>{{ form.ptype || '-' }}</span>
</el-form-item> </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> </el-form>
</div> </div>
...@@ -21,20 +21,20 @@ ...@@ -21,20 +21,20 @@
<div class="searchInput"> <div class="searchInput">
<el-form 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">
<el-form-item label="位置"> <el-form-item label="位置">
<el-input v-model="searchForm.search" @keyup.enter.native="handleSearch"></el-input> <el-input v-model="searchForm.search" @keyup.enter.native="handleSearch" />
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
<div class="disposeTableContent"> <div class="disposeTableContent">
<el-table :data="tableList" :row-class-name="tableRowClassName" style="width: 100%"> <el-table :data="tableList" :row-class-name="tableRowClassName" style="width: 100%">
<el-table-column label="location" > <el-table-column label="location">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{scope.row.location || '-'}}</span> <span>{{ scope.row.location || '-' }}</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>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -42,25 +42,28 @@ ...@@ -42,25 +42,28 @@
</div> </div>
<div class="totalNumber"> <div class="totalNumber">
<div class="label">总计:</div> <div class="label">总计:</div>
<div class="number" v-if="total > 0">{{total}}</div> <div v-if="total > 0" class="number">{{ total }}</div>
</div> </div>
<div class="button_row"> <div class="button_row">
<el-button class="button_rowBtn" type="primary" @click="handleSave" >出库</el-button> <el-button class="button_rowBtn" type="primary" @click="handleSave">出库</el-button>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import {handleOutWarehouse, persistOut} from "@/api/setup/applicationTable"; import { handleOutWarehouse, persistOut } from '@/api/setup/applicationTable'
export default { export default {
name: "dispose", name: 'Dispose',
data() { data() {
return{ return {
// 总计 // 总计
total: 0, total: 0,
rowIndexList:[], rowIndexList: [],
// 当前高亮的索引
currentIndex: -1,
SearchKeyword: '',
businessId: null, businessId: null,
form: { form: {
...@@ -78,9 +81,9 @@ export default { ...@@ -78,9 +81,9 @@ export default {
this.getDetail() this.getDetail()
}, },
methods: { methods: {
tableRowClassName({row, rowIndex}){ tableRowClassName({ row, rowIndex }) {
if (this.rowIndexList.includes(rowIndex)) { if (this.rowIndexList.includes(rowIndex)) {
return 'hight_row'; return 'hight_row'
} }
}, },
// 获取详情 // 获取详情
...@@ -90,7 +93,7 @@ export default { ...@@ -90,7 +93,7 @@ export default {
businessId: this.businessId businessId: this.businessId
} }
handleOutWarehouse(obj).then(res => { handleOutWarehouse(obj).then(res => {
console.log('res',res) console.log('res', res)
if (res.code === 200) { if (res.code === 200) {
this.form = res.data this.form = res.data
this.tableList = res.data.boxList this.tableList = res.data.boxList
...@@ -98,14 +101,39 @@ export default { ...@@ -98,14 +101,39 @@ export default {
}) })
}, },
// 查询回 // 查询回
// handleSearch() {
// this.tableList.forEach((item, index) => {
// if (item.location === this.searchForm.search) {
// this.rowIndexList.push(index)
// this.total = this.total + item.needNumber
// }
// })
// },
handleSearch() { handleSearch() {
this.tableList.forEach((item,index) => { const keyword = this.searchForm.search
if (item.location === this.searchForm.search) { // 如果搜索关键字与上一次相同,则从当前索引的下一个位置开始搜索
this.rowIndexList.push(index) if (keyword === this.SearchKeyword) {
this.currentIndex++
} else {
// 如果搜索关键字发生变化,则重置索引为-1,并更新上一次搜索的关键字
this.currentIndex = -1
this.SearchKeyword = keyword
}
// 清空之前的高亮记录
this.rowIndexList = []
// 查找匹配项,并将其索引添加到rowIndexList中
for (let i = this.currentIndex + 1; i < this.tableList.length; i++) {
const item = this.tableList[i]
if (item.location === keyword) {
this.rowIndexList.push(i)
this.total = this.total + item.needNumber this.total = this.total + item.needNumber
// 找到匹配项后,跳出循环
break
}
} }
})
}, },
// 出库 // 出库
handleSave() { handleSave() {
if (this.total === this.form.qty) { if (this.total === this.form.qty) {
...@@ -115,9 +143,9 @@ export default { ...@@ -115,9 +143,9 @@ export default {
businessId: this.businessId, businessId: this.businessId,
boxList: this.tableList boxList: this.tableList
} }
console.log('参数',obj) console.log('参数', obj)
persistOut(obj).then(res => { persistOut(obj).then(res => {
console.log('res',res) console.log('res', res)
if (res.code === 200) { if (res.code === 200) {
this.$router.push({ this.$router.push({
path: '/setup/applicationTable' path: '/setup/applicationTable'
...@@ -125,7 +153,7 @@ export default { ...@@ -125,7 +153,7 @@ export default {
} }
}) })
} else { } else {
this.$message.warning("您所选择的库存数量小于您申请的数量") this.$message.warning('您所选择的库存数量小于您申请的数量')
} }
} }
} }
...@@ -135,7 +163,7 @@ export default { ...@@ -135,7 +163,7 @@ export default {
<style lang="scss"> <style lang="scss">
.dispose-module{ .dispose-module{
.hight_row { .hight_row {
background: #1890ff !important; /* 设置高亮行的背景色 */ background: #FFCC66 !important; /* 设置高亮行的背景色 */
} }
.search{ .search{
width: 96%; width: 96%;
......
...@@ -64,6 +64,7 @@ export default { ...@@ -64,6 +64,7 @@ export default {
responsePn: '', responsePn: '',
orderCode: '', orderCode: '',
warehouseList: [], warehouseList: [],
confirmTheSubmission: false,
typeList: [ typeList: [
{ {
label: 'label', label: 'label',
...@@ -221,6 +222,7 @@ export default { ...@@ -221,6 +222,7 @@ export default {
console.log('responsePn', this.responsePn) console.log('responsePn', this.responsePn)
if (this.form.pn !== this.responsePn) { if (this.form.pn !== this.responsePn) {
this.$message.error('您输入的pn与返回pn的不一样') this.$message.error('您输入的pn与返回pn的不一样')
this.confirmTheSubmission = false
} else { } else {
const obj = { const obj = {
pn: this.form.pn, pn: this.form.pn,
...@@ -235,7 +237,7 @@ export default { ...@@ -235,7 +237,7 @@ export default {
this.$refs.input3.focus() this.$refs.input3.focus()
}) })
}) })
return true this.confirmTheSubmission = true
} }
} else { } else {
const obj = { const obj = {
...@@ -249,13 +251,14 @@ export default { ...@@ -249,13 +251,14 @@ export default {
this.$nextTick().then(() => { this.$nextTick().then(() => {
this.$refs.input3.focus() this.$refs.input3.focus()
}) })
this.confirmTheSubmission = true
} else { } else {
this.$nextTick().then(() => { this.$nextTick().then(() => {
this.$refs.input3.focus() this.$refs.input3.focus()
}) })
} }
}) })
return true this.confirmTheSubmission = true
} }
}, },
/** /**
...@@ -265,10 +268,8 @@ export default { ...@@ -265,10 +268,8 @@ export default {
* @return: * @return:
**/ **/
SubmitForm() { SubmitForm() {
console.log(11111111111)
this.$refs.from.validate(valid => { this.$refs.from.validate(valid => {
console.log(2222222222222222222222) if (valid && this.confirmTheSubmission) {
if (valid && this.validPn()) {
this.form.qty = Number(this.form.qty) this.form.qty = Number(this.form.qty)
addIncomeWmsBox(this.form).then(res => { addIncomeWmsBox(this.form).then(res => {
if (res.code === 200) { if (res.code === 200) {
......
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