接口
This commit is contained in:
@@ -49,7 +49,7 @@
|
||||
</view>
|
||||
<view class="zd-row submit-bar">
|
||||
<button class="zd-col-6 button-primary" @tap="seachList">查询</button>
|
||||
<button class="zd-col-16 button-primary" :class="{'button-info': !pkId}" @tap="toSure">确认</button>
|
||||
<button class="zd-col-16 button-primary" :class="{'button-info': !pkId}" @tap="_materialConfirm">确认</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -57,7 +57,7 @@
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import {outStorageOrder, outStorageOrderList} from '@/utils/getData2.js'
|
||||
import {getMaterialDtl, materialConfirm} from '@/utils/getData3.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
@@ -93,39 +93,24 @@
|
||||
this.id = options.id
|
||||
},
|
||||
created () {
|
||||
this._outStorageOrder()
|
||||
},
|
||||
methods: {
|
||||
/** 下拉框*/
|
||||
async _outStorageOrder () {
|
||||
let res = await outStorageOrder()
|
||||
this.options = [...res]
|
||||
},
|
||||
selectChange (e) {
|
||||
this.index = e
|
||||
if (e) {
|
||||
this.dataList = []
|
||||
this.pageNum = 1
|
||||
this.pkId = ''
|
||||
this._outStorageOrderList(e, this.code)
|
||||
}
|
||||
},
|
||||
handleChange (e) {
|
||||
if (e) {
|
||||
this.dataList = []
|
||||
this.pageNum = 1
|
||||
this.pkId = ''
|
||||
this._outStorageOrderList(this.index, e)
|
||||
this._getMaterialDtl()
|
||||
}
|
||||
},
|
||||
seachList () {
|
||||
this.dataList = []
|
||||
this.pageNum = 1
|
||||
this.pkId = ''
|
||||
this._outStorageOrderList(this.index, this.code)
|
||||
this._getMaterialDtl()
|
||||
},
|
||||
async _outStorageOrderList (index, e) {
|
||||
let res = await outStorageOrderList(this.pageNum + '', this.pageSize + '', index, e)
|
||||
async _getMaterialDtl () {
|
||||
let res = await getMaterialDtl(this.val1, this.val2, this.pageNum + '', this.pageSize + '')
|
||||
if (res.code === '200') {
|
||||
this.totalCount = res.totalElements
|
||||
if (res.totalElements > 0) {
|
||||
@@ -146,22 +131,39 @@
|
||||
this.status = 'loading'
|
||||
setTimeout(() => {
|
||||
this.pageNum++
|
||||
this._outStorageOrderList(this.index, this.code)
|
||||
this._getMaterialDtl()
|
||||
}, 1000)
|
||||
} else { //停止加载
|
||||
this.status = 'noMore'
|
||||
}
|
||||
},
|
||||
toChek (e) {
|
||||
this.pkId = this.pkId === e.code ? '' : e.code
|
||||
this.pkObj = this.pkId === e.code ? e : {}
|
||||
this.pkId = this.pkId === e.group_id ? '' : e.group_id
|
||||
this.pkObj = this.pkId === e.group_id ? e : {}
|
||||
},
|
||||
toSure () {
|
||||
if (this.pkId) {
|
||||
this.$store.dispatch('setPublicObj', this.pkObj)
|
||||
uni.navigateTo({
|
||||
url: '/pages/outbound/bill-out-store?title=单据出库'
|
||||
})
|
||||
async _materialConfirm () {
|
||||
this.disabled = true
|
||||
if (!this.val1 || !this.val2 || !this.pkId) {
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await materialConfirm(this.pkId, this.pkObj.storagevehicle_code, this.val1, this.val2)
|
||||
if (res.code === '200') {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
this.clearUp()
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
this.disabled = false
|
||||
}
|
||||
} catch (e) {
|
||||
this.disabled = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user