接口联调,合并出入库页面
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<nav-bar title="入库"></nav-bar>
|
||||
<nav-bar :title="crType === 'IN' ? '入库' : '出库'"></nav-bar>
|
||||
<view class="search-confirm-wrap">
|
||||
<view class="zd-row">
|
||||
<view class="zd-col-11 zd-row">
|
||||
@@ -73,10 +73,9 @@
|
||||
</view>
|
||||
<view class="zd-row mgt40">
|
||||
<view class="zd-col-12 zd-row jcflexstart">
|
||||
<button class="confirm-button" :class="{'confirm-button_disabled': checkArr2.length === 0}" :disabled="disabled2" @tap="_easOutInBillDetailUpdate">多库位修改</button>
|
||||
<button class="confirm-button" :class="{'confirm-button_disabled': checkArr2.length !== 1}" @tap="_queryInventoryInfo">单库位修改</button>
|
||||
<button class="confirm-button" :class="{'confirm-button_disabled': checkArr2.length === 0}" @tap="kuwConfirm">库位修改</button>
|
||||
</view>
|
||||
<view class="zd-col-12">
|
||||
<view class="zd-col-12 zd-row jcflexend">
|
||||
<pagination :total="totalCount2" :page-size="queryParams2.pageSize" :current-page="currentPage2" @page-change="handlePageChange2" />
|
||||
</view>
|
||||
</view>
|
||||
@@ -85,9 +84,9 @@
|
||||
</view>
|
||||
<pagination v-show="dataList1.length > 0" :total="totalCount1" :page-size="queryParams1.pageSize" :current-page="currentPage1" @page-change="handlePageChange1" />
|
||||
</view>
|
||||
<view class="pop-wraper" :class="show ? 'popshow' : 'pophide'">
|
||||
<view class="allwidth pop-title">库位修改</view>
|
||||
<view class="pop-grid-wraper">
|
||||
<view class="pop-wraper" :class="{'popshow': show, 'pophide': !show, 'pop-wraper_1': type === '2'}">
|
||||
<view class="allwidth pop-title">{{type === '1' ?'库位修改' : '库位确认'}}</view>
|
||||
<view v-if="type === '1'" class="pop-grid-wraper">
|
||||
<view class="zd-row zd-sec-th-wraper zd-pop-th-wraper">
|
||||
<view class="zd-col-2 zd-sec-th"><text>序号</text></view>
|
||||
<view class="zd-col-4 zd-sec-th"><text>出库单号</text></view>
|
||||
@@ -98,26 +97,33 @@
|
||||
</view>
|
||||
<view class="zd-row zd-td-wraper" v-for="(ele, t) in dataList3" :key="ele.id">
|
||||
<view class="zd-col-2 zd-sec-td zd-pop-td"><text>{{t+1}}</text></view>
|
||||
<view class="zd-col-4 zd-sec-td zd-pop-td"><text>{{ele.code}}</text></view>
|
||||
<view class="zd-col-4 zd-sec-td zd-pop-td"><text>{{ele.code}}</text></view>
|
||||
<view class="zd-col-5 zd-sec-td zd-pop-td"><text>{{ele.code}}</text></view>
|
||||
<view class="zd-col-4 zd-sec-td zd-pop-td"><text>{{ele.djbh}}</text></view>
|
||||
<view class="zd-col-4 zd-sec-td zd-pop-td"><text>{{ele.kwlx}}</text></view>
|
||||
<view class="zd-col-5 zd-sec-td zd-pop-td"><text>{{ele.kwlx}}</text></view>
|
||||
<view class="zd-col-5 zd-sec-td zd-pop-td">
|
||||
<scan-input
|
||||
v-model="ele.ckmc"
|
||||
v-model="ele.wlbm"
|
||||
/>
|
||||
</view>
|
||||
<view class="zd-col-4 zd-sec-td zd-pop-td">
|
||||
<input v-show="!ele.checked" type="number" class="pop-input" v-model="ele.qty" @blur="handleBlur(ele)">
|
||||
<text v-show="ele.checked">{{ele.qty}}</text>
|
||||
<input v-show="!ele.checked" type="number" class="pop-input" v-model="ele.sl" @blur="handleBlur(ele)">
|
||||
<text v-show="ele.checked">{{ele.sl}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else class="zd-row jcenter kwcode_wraper">
|
||||
<view class="zd-col-12">
|
||||
<scan-input
|
||||
v-model="kwCode"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row jcenter">
|
||||
<view class="zd-col-4">
|
||||
<button class="confirm-button confirm-button_cancle" @tap="show = false">取消</button>
|
||||
</view>
|
||||
<view class="zd-col-4">
|
||||
<button class="confirm-button" :class="{'confirm-button_disabled': dataList3.length === 0}" :disabled="disabled3" @tap="_easOutInBillDetailUpdate1">确定</button>
|
||||
<button class="confirm-button" :class="{'confirm-button_disabled': (type === '1' && dataList3.length === 0) || (type === '2' && kwCode === '')}" :disabled="disabled2" @tap="modalConfirm">确定</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -142,6 +148,7 @@
|
||||
return {
|
||||
title: '',
|
||||
id: '',
|
||||
crType: '',
|
||||
val1: '',
|
||||
dataList1: [],
|
||||
dataList2: [],
|
||||
@@ -165,7 +172,8 @@
|
||||
checkArr2: [],
|
||||
disabled2: false,
|
||||
show: false,
|
||||
disabled3: false
|
||||
type: '',
|
||||
kwCode: ''
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
@@ -179,6 +187,7 @@
|
||||
onLoad (options) {
|
||||
this.id = options.id
|
||||
this.title = options.name
|
||||
this.crType = options.type
|
||||
},
|
||||
created () {
|
||||
this.toSearch()
|
||||
@@ -256,7 +265,7 @@
|
||||
toCheck1 (e) {
|
||||
e.checked = !e.checked
|
||||
let arr = this.dataList1.filter(el => el.checked === true)
|
||||
this.checkArr1 = arr.map(el => {return el.code})
|
||||
this.checkArr1 = arr.map(el => {return el.id})
|
||||
},
|
||||
async toSure () {
|
||||
this.disabled1 = true
|
||||
@@ -289,44 +298,24 @@
|
||||
e.checked = !e.checked
|
||||
this.checkArr2 = this.dataList2.filter(el => el.checked === true)
|
||||
},
|
||||
async _easOutInBillDetailUpdate () {
|
||||
this.disabled2 = true
|
||||
if (this.checkArr2.length === 0) {
|
||||
this.disabled2 = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await easOutInBillDetailUpdate(this.checkArr2)
|
||||
if (res.code === 1) {
|
||||
this.disabled2 = false
|
||||
this.checkArr2 = []
|
||||
this.queryParams2 = {
|
||||
pageSize: 10,
|
||||
pageNum: 1
|
||||
}
|
||||
this.currentPage2 = 1
|
||||
this._easOutInBillDetailPage()
|
||||
uni.showToast({
|
||||
title: res.desc,
|
||||
icon: 'none'
|
||||
})
|
||||
kuwConfirm () {
|
||||
if (this.checkArr2.length === 0) {
|
||||
return
|
||||
} else if (this.checkArr2.length === 1) {
|
||||
this.type = '1'
|
||||
this._queryInventoryInfo()
|
||||
} else {
|
||||
this.disabled2 = false
|
||||
uni.showToast({
|
||||
title: res.desc,
|
||||
icon: 'none'
|
||||
})
|
||||
this.type = '2'
|
||||
this.show = true
|
||||
this.kwCode = ''
|
||||
}
|
||||
} catch (e) {
|
||||
this.disabled2 = false
|
||||
}
|
||||
},
|
||||
async _queryInventoryInfo () {
|
||||
let res = await queryInventoryInfo(this.checkArr2)
|
||||
if (res.code ===1) {
|
||||
res.result.map(el => {
|
||||
this.$set(el, 'checked', false)
|
||||
this.$set(el, 'yqty', el.qty)
|
||||
this.$set(el, 'yqty', el.sl)
|
||||
})
|
||||
this.dataList3 = [...res.result]
|
||||
this.show = true
|
||||
@@ -338,28 +327,47 @@
|
||||
}
|
||||
},
|
||||
handleBlur (ele) {
|
||||
if (Number(ele.sl) >= Number(ele.yqty)) {
|
||||
ele.sl = ele.yqty
|
||||
return
|
||||
}
|
||||
ele.checked = true
|
||||
let index = ''
|
||||
let obj = {}
|
||||
this.dataList3.map((e, i) => {
|
||||
if (e.id === ele.id) {
|
||||
index = i
|
||||
obj = Object.assign({}, e, {'checked': false}, {'ckmc': ''}, {id: e.id + Math.random() * 1000}, {qty: Number(e.yqty) - Number(ele.qty)}, {yqty: Number(e.yqty) - Number(ele.qty)})
|
||||
obj = Object.assign({}, e, {'checked': false}, {'wlbm': ''}, {id: e.id + Math.random() * 1000}, {sl: Number(e.yqty) - Number(ele.sl)}, {yqty: Number(e.yqty) - Number(ele.sl)})
|
||||
}
|
||||
})
|
||||
this.dataList3.splice(index+1, 0, obj)
|
||||
this.dataList3 = [...this.dataList3]
|
||||
},
|
||||
async _easOutInBillDetailUpdate1 () {
|
||||
this.disabled3 = true
|
||||
if (this.dataList3.length === 0) {
|
||||
this.disabled3 = false
|
||||
return
|
||||
}
|
||||
modalConfirm () {
|
||||
this.disabled2 = true
|
||||
let arr = []
|
||||
if (this.type === '1' && this.dataList3.length === 0) {
|
||||
this.disabled2 = false
|
||||
return
|
||||
} else if (this.type === '2' && this.kwCode === '') {
|
||||
this.disabled2 = false
|
||||
return
|
||||
} else if (this.type === '1') {
|
||||
arr = this.dataList3
|
||||
} else if (this.type === '2') {
|
||||
this.checkArr2.map(el => {
|
||||
el.wlbm = this.kwCode
|
||||
})
|
||||
arr = this.checkArr2
|
||||
}
|
||||
this._easOutInBillDetailUpdate(arr)
|
||||
},
|
||||
async _easOutInBillDetailUpdate (arr) {
|
||||
try {
|
||||
let res = await easOutInBillDetailUpdate(this.dataList3)
|
||||
|
||||
let res = await easOutInBillDetailUpdate(arr)
|
||||
if (res.code === 1) {
|
||||
this.disabled3 = false
|
||||
this.disabled2 = false
|
||||
this.show = false
|
||||
this.queryParams2 = {
|
||||
pageSize: 10,
|
||||
@@ -372,14 +380,14 @@
|
||||
icon: 'none'
|
||||
})
|
||||
} else {
|
||||
this.disabled3 = false
|
||||
this.disabled2 = false
|
||||
uni.showToast({
|
||||
title: res.desc,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
} catch (e) {
|
||||
this.disabled3 = false
|
||||
this.disabled2 = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user