接口联调,合并出入库页面
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
<view class="menu-item" v-for="(e, i) in menuList" :key="i" @tap="toPage(e)">
|
||||
<view class="menu_name_bg" :class="'bg_texture_' + i">
|
||||
<view class="menu-name">{{e.name}}</view>
|
||||
<view class="bill_count">{{e.counts}}</view>
|
||||
<view v-show="Number(e.counts) > 0" class="bill_count">{{e.counts}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -52,11 +52,7 @@
|
||||
},
|
||||
toPage (e) {
|
||||
let url = ''
|
||||
if (e.ywlx === 'OUT') {
|
||||
url = '/pages/management/out-storage?id=' + e.djlx + '&name=' + e.name
|
||||
} else {
|
||||
url = '/pages/management/in-storage?id=' + e.djlx + '&name=' + e.name
|
||||
}
|
||||
url = '/pages/management/in-storage?id=' + e.djlx + '&name=' + e.name + '&type=' + e.ywlx
|
||||
uni.redirectTo({
|
||||
url: url
|
||||
})
|
||||
|
||||
@@ -225,7 +225,7 @@
|
||||
line-height 90rpx
|
||||
.login_icon
|
||||
position absolute
|
||||
top 0
|
||||
top 5px
|
||||
right 10px
|
||||
.primary-button
|
||||
_wh(auto, 100rpx)
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,391 +0,0 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<nav-bar title="出库"></nav-bar>
|
||||
<view class="search-confirm-wrap">
|
||||
<view class="zd-row">
|
||||
<view class="zd-col-11 zd-row">
|
||||
<search-box
|
||||
v-model="val1"
|
||||
/>
|
||||
<button class="confirm-button" @tap="toSearch">查询</button>
|
||||
</view>
|
||||
<view class="zd-col-11 zd-row jcflexend">
|
||||
<button class="confirm-button" :class="{'confirm-button_disabled': checkArr1.length === 0}" :disabled="disabled1" @tap="toSure">单据审核</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row jcflexstart table-title_wraper">{{title}}</view>
|
||||
<view class="grid-wrap">
|
||||
<view class="table-wrap">
|
||||
<view class="zd-row zd-th-wraper">
|
||||
<view class="zd-col-2 zd-th"><text>序号</text></view>
|
||||
<view class="zd-col-2 zd-th"><text>选择</text></view>
|
||||
<view class="zd-col-3 zd-th"><text>入库单号</text></view>
|
||||
<view class="zd-col-3 zd-th"><text>EAS单号</text></view>
|
||||
<view class="zd-col-2 zd-th"><text>状态</text></view>
|
||||
<view class="zd-col-3 zd-th"><text>去向</text></view>
|
||||
<view class="zd-col-3 zd-th"><text>入库日期</text></view>
|
||||
<view class="zd-col-3 zd-th"><text>领料人</text></view>
|
||||
<view class="zd-col-3 zd-th"><text>制单人</text></view>
|
||||
</view>
|
||||
<view class="zd-td-wraper" v-for="(e, i) in dataList1" :key="e.id">
|
||||
<view class="zd-row" :class="{'zd-td-checked': pkId === e.id}">
|
||||
<view class="zd-col-2 zd-td" @tap.stop="toCollapse(e)"><text>{{i+1}}</text></view>
|
||||
<view class="zd-col-2 zd-td" @tap.stop="toCheck1(e)">
|
||||
<view class="zd-checkbox" :class="{'zd-checkbox_active': e.checked}"></view>
|
||||
</view>
|
||||
<view class="zd-col-3 zd-td fontcol1" @tap.stop="toCollapse(e)"><text>{{e.code}}</text></view>
|
||||
<view class="zd-col-3 zd-td" @tap.stop="toCollapse(e)"><text>{{e.djbh}}</text></view>
|
||||
<view class="zd-col-2 zd-td" @tap.stop="toCollapse(e)"><text class="fontbg1">{{e.djzt}}</text></view>
|
||||
<view class="zd-col-3 zd-td" @tap.stop="toCollapse(e)"><text>{{e.ckmc}}</text></view>
|
||||
<view class="zd-col-3 zd-td" @tap.stop="toCollapse(e)"><text>{{e.cksj}}</text></view>
|
||||
<view class="zd-col-3 zd-td" @tap.stop="toCollapse(e)"><text>{{e.llr}}</text></view>
|
||||
<view class="zd-col-3 zd-td" @tap.stop="toCollapse(e)"><text>{{e.cjr}}</text></view>
|
||||
</view>
|
||||
<view v-show="pkId === e.id" class="zd-sec-wraper">
|
||||
<view class="zd-row zd-sec-th-wraper">
|
||||
<view class="zd-col-1 zd-sec-th"><text>序号</text></view>
|
||||
<view class="zd-col-1 zd-sec-th"><text>选择</text></view>
|
||||
<view class="zd-col-2 zd-sec-th"><text>入库单号</text></view>
|
||||
<view class="zd-col-2 zd-sec-th"><text>明细编号</text></view>
|
||||
<view class="zd-col-2 zd-sec-th"><text>存货编号</text></view>
|
||||
<view class="zd-col-2 zd-sec-th"><text>物料编号</text></view>
|
||||
<view class="zd-col-3 zd-sec-th"><text>物料名称</text></view>
|
||||
<view class="zd-col-2 zd-sec-th"><text>推荐库位</text></view>
|
||||
<view class="zd-col-2 zd-sec-th"><text>实际库位</text></view>
|
||||
<view class="zd-col-2 zd-sec-th"><text>已入数量</text></view>
|
||||
<view class="zd-col-2 zd-sec-th"><text>数量</text></view>
|
||||
<view class="zd-col-3 zd-sec-th"><text>单据日期</text></view>
|
||||
</view>
|
||||
<view class="zd-row zd-td-wraper" v-for="(el, j) in dataList2" :key="el.id" @tap.stop="toCheck2(el)">
|
||||
<view class="zd-col-1 zd-sec-td"><text>{{j+1}}</text></view>
|
||||
<view class="zd-col-1 zd-sec-td"><view class="zd-checkbox" :class="{'zd-checkbox_active': el.checked}"></view></view>
|
||||
<view class="zd-col-2 zd-sec-td"><text>{{el.djbh}}</text></view>
|
||||
<view class="zd-col-2 zd-sec-td"><text>{{el.zzbm}}</text></view>
|
||||
<view class="zd-col-2 zd-sec-td"><text>{{el.kwbm}}</text></view>
|
||||
<view class="zd-col-2 zd-sec-td"><text>{{el.wlbm}}</text></view>
|
||||
<view class="zd-col-3 zd-sec-td"><text>{{el.wlmc}}</text></view>
|
||||
<view class="zd-col-2 zd-sec-td"><text>{{el.djbh}}</text></view>
|
||||
<view class="zd-col-2 zd-sec-td"><text>{{el.djbh}}</text></view>
|
||||
<view class="zd-col-2 zd-sec-td"><text>{{el.jbsl}}</text></view>
|
||||
<view class="zd-col-2 zd-sec-td"><text>{{el.fzsl}}</text></view>
|
||||
<view class="zd-col-3 zd-sec-td"><text>{{el.cksj}}</text></view>
|
||||
</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>
|
||||
</view>
|
||||
<view class="zd-col-12">
|
||||
<pagination :total="totalCount2" :page-size="queryParams2.pageSize" :current-page="currentPage2" @page-change="handlePageChange2" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</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="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>
|
||||
<view class="zd-col-4 zd-sec-th"><text>物料编号</text></view>
|
||||
<view class="zd-col-5 zd-sec-th"><text>物料名称</text></view>
|
||||
<view class="zd-col-5 zd-sec-th"><text>实际库位</text></view>
|
||||
<view class="zd-col-4 zd-sec-th"><text>数量</text></view>
|
||||
</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-5 zd-sec-td zd-pop-td">
|
||||
<scan-input
|
||||
v-model="ele.ckmc"
|
||||
/>
|
||||
</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>
|
||||
</view>
|
||||
</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>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="show" class="modal" @click.stop="show = false"></view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import ScanInput from '@/components/ScanInput.vue'
|
||||
import Pagination from '@/components/Pagination.vue'
|
||||
import {easOutInBillPage, easOutInBillDetailPage, easOutInBillUpdate, easOutInBillDetailUpdate, queryInventoryInfo} from '@/utils/getData2.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
SearchBox,
|
||||
ScanInput,
|
||||
Pagination
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: '',
|
||||
id: '',
|
||||
val1: '',
|
||||
dataList1: [],
|
||||
dataList2: [],
|
||||
dataList3: [],
|
||||
pkId: '',
|
||||
pkObj: {},
|
||||
checkArr1: [],
|
||||
disabled1: false,
|
||||
totalCount1: 0,
|
||||
queryParams1:{
|
||||
pageSize: 10,
|
||||
pageNum: 1
|
||||
},
|
||||
currentPage1: 1,
|
||||
totalCount2: 0,
|
||||
queryParams2:{
|
||||
pageSize: 5,
|
||||
pageNum: 1
|
||||
},
|
||||
currentPage2: 1,
|
||||
checkArr2: [],
|
||||
disabled2: false,
|
||||
show: false,
|
||||
disabled3: false
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
if (this.$store.getters.publicArr) {
|
||||
this.dataList1 = this.$store.getters.publicArr
|
||||
}
|
||||
},
|
||||
destroyed () {
|
||||
this.$store.dispatch('setPublicArr', '')
|
||||
},
|
||||
onLoad (options) {
|
||||
this.id = options.id
|
||||
this.title = options.name
|
||||
},
|
||||
created () {
|
||||
this.toSearch()
|
||||
},
|
||||
methods: {
|
||||
toSearch () {
|
||||
this.queryParams1 = {
|
||||
pageSize: 10,
|
||||
pageNum: 1
|
||||
}
|
||||
this.currentPage1 = 1
|
||||
this.dataList2 = []
|
||||
this._easOutInBillPage()
|
||||
},
|
||||
async _easOutInBillPage () {
|
||||
let res = await easOutInBillPage(this.val1, this.id, this.queryParams1.pageNum + '', this.queryParams1.pageSize + '')
|
||||
if (res.code === 1) {
|
||||
this.checkArr1 = []
|
||||
res.result.map(el => {
|
||||
this.$set(el, 'checked', false)
|
||||
})
|
||||
this.dataList1 = [...res.result]
|
||||
this.totalCount1 = Number(res.totalElements)
|
||||
this.queryParams1.pageSize = Number(res.pageSize)
|
||||
this.queryParams1.pageNum = Number(res.pageNum)
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.desc,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
},
|
||||
async _easOutInBillDetailPage () {
|
||||
let res = await easOutInBillDetailPage(this.pkObj.djid, this.queryParams2.pageNum + '', this.queryParams2.pageSize + '')
|
||||
if (res.code === 1) {
|
||||
this.checkArr2 = []
|
||||
res.result.map(el => {
|
||||
this.$set(el, 'checked', false)
|
||||
})
|
||||
this.dataList2 = [...res.result]
|
||||
this.totalCount2 = Number(res.totalElements)
|
||||
this.queryParams2.pageSize = Number(res.pageSize)
|
||||
this.queryParams2.pageNum = Number(res.pageNum)
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.desc,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
},
|
||||
handlePageChange1(page) {
|
||||
this.queryParams1.pageNum = page
|
||||
this.currentPage1 = page
|
||||
this.dataList2 = []
|
||||
this.pkId = ''
|
||||
this._easOutInBillPage()
|
||||
},
|
||||
handlePageChange2(page) {
|
||||
this.queryParams2.pageNum = page
|
||||
this.currentPage2 = page
|
||||
this._easOutInBillDetailPage()
|
||||
},
|
||||
toCollapse (e) {
|
||||
this.pkId = this.pkId === e.id ? '' : e.id
|
||||
this.pkObj = this.pkId === e.id ? e : {}
|
||||
if (this.pkId === e.id) {
|
||||
this.queryParams2 = {
|
||||
pageSize: 10,
|
||||
pageNum: 1
|
||||
}
|
||||
this.currentPage2 = 1
|
||||
this._easOutInBillDetailPage()
|
||||
}
|
||||
},
|
||||
toCheck1 (e) {
|
||||
e.checked = !e.checked
|
||||
let arr = this.dataList1.filter(el => el.checked === true)
|
||||
this.checkArr1 = arr.map(el => {return el.code})
|
||||
},
|
||||
async toSure () {
|
||||
this.disabled1 = true
|
||||
if (this.checkArr1.length === 0) {
|
||||
this.disabled1 = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await easOutInBillUpdate(this.checkArr1)
|
||||
if (res.code === 1) {
|
||||
this.disabled1 = false
|
||||
this.checkArr1 = []
|
||||
this.toSearch()
|
||||
uni.showToast({
|
||||
title: res.desc,
|
||||
icon: 'none'
|
||||
})
|
||||
} else {
|
||||
this.disabled1 = false
|
||||
uni.showToast({
|
||||
title: res.desc,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
} catch (e) {
|
||||
this.disabled1 = false
|
||||
}
|
||||
},
|
||||
toCheck2 (e) {
|
||||
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'
|
||||
})
|
||||
} else {
|
||||
this.disabled2 = false
|
||||
uni.showToast({
|
||||
title: res.desc,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
} 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.dataList3 = [...res.result]
|
||||
this.show = true
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.desc,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
},
|
||||
handleBlur (ele) {
|
||||
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)})
|
||||
}
|
||||
})
|
||||
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
|
||||
}
|
||||
try {
|
||||
let res = await easOutInBillDetailUpdate(this.dataList3)
|
||||
if (res.code === 1) {
|
||||
this.disabled3 = false
|
||||
this.show = false
|
||||
this.queryParams2 = {
|
||||
pageSize: 10,
|
||||
pageNum: 1
|
||||
}
|
||||
this.currentPage2 = 1
|
||||
this._easOutInBillDetailPage()
|
||||
uni.showToast({
|
||||
title: res.desc,
|
||||
icon: 'none'
|
||||
})
|
||||
} else {
|
||||
this.disabled3 = false
|
||||
uni.showToast({
|
||||
title: res.desc,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
} catch (e) {
|
||||
this.disabled3 = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
@import '../../common/style/mixin.styl';
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user