单据出库修改

This commit is contained in:
蔡玲
2024-12-03 18:36:55 +08:00
parent e415dc41fe
commit 922c52dcb7
4 changed files with 188 additions and 101 deletions

View File

@@ -3,6 +3,19 @@
<!-- 单据列表 -->
<nav-bar :title="title" :inner="true"></nav-bar>
<view class="zd_content">
<view class="zd_wrapper">
<view class="zd-row">
<view class="zd-col-7">
<span class="filter_label">单据编码</span>
</view>
<view class="zd-col-24">
<search-box
v-model="code"
@handleChange="handleChange"
/>
</view>
</view>
</view>
<view class="zd_wrapper grid-wraper">
<view class="slide_new">
<table>
@@ -17,8 +30,8 @@
<th>申请数量</th>
<th>计划数量</th>
<th>已分配数量</th>
<th>单位</th>
<th>批次号</th>
<th>单位</th>
</tr>
</thead>
<tbody>
@@ -32,20 +45,18 @@
<td>{{e.qty}}</td>
<td>{{e.plan_qty}}</td>
<td>{{e.assign_qty}}</td>
<td>{{e.unit_id}}</td>
<td>{{e.pcsn}}</td>
<td>{{e.unit_name}}</td>
</tr>
</tbody>
</table>
</view>
</view>
<uni-load-more color="#007AFF" iconType="circle" :status="status" :icon-size="14" :content-text="contentText" v-if="dataList.length > 0"/>
</view>
<view class="compute_wraper">
</view>
<view class="zd-row submit-bar">
<button class="zd-col-22 button-primary" :class="{'button-info': !pkId}" @tap="toSure">确认</button>
<button class="zd-col-6 button-primary" @tap="seachList">查询</button>
<button class="zd-col-16 button-primary" :class="{'button-info': !pkId}" :disabled="disabled" @tap="_outStorageOrderConfirm">确认</button>
</view>
</view>
</template>
@@ -53,7 +64,7 @@
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {outStorageOrder, outStorageOrderList, outStorageConfirm} from '@/utils/getData2.js'
import {outStorageOrderList, outStorageOrderConfirm} from '@/utils/getData2.js'
export default {
components: {
NavBar,
@@ -63,9 +74,9 @@
return {
title: '',
id: '',
code: '',
dataList: [],
pkId: '',
pkObj: {},
disabled: false,
reload: false,
status: 'more',
@@ -85,8 +96,22 @@
this._outStorageOrderList()
},
methods: {
async _outStorageOrderList () {
let res = await outStorageOrderList(this.pageNum + '', this.pageSize + '', this.id)
handleChange (e) {
if (e) {
this.dataList = []
this.pageNum = 1
this.pkId = ''
this._outStorageOrderList(e)
}
},
seachList () {
this.dataList = []
this.pageNum = 1
this.pkId = ''
this._outStorageOrderList(this.code)
},
async _outStorageOrderList (e) {
let res = await outStorageOrderList(this.pageNum + '', this.pageSize + '', this.id, e)
if (res.code === '200') {
this.totalCount = res.totalElements
if (res.totalElements > 0) {
@@ -107,7 +132,7 @@
this.status = 'loading'
setTimeout(() => {
this.pageNum++
this._outStorageOrderList()
this._outStorageOrderList(this.code)
}, 1000)
} else { //停止加载
this.status = 'noMore'
@@ -115,12 +140,29 @@
},
toChek (e) {
this.pkId = this.pkId === e.code ? '' : e.code
this.pkObj = this.pkId === e.code ? e : {}
},
toSure () {
if (this.pkId) {
this.$store.dispatch('setPublicObj', this.pkObj)
uni.navigateBack()
async _outStorageOrderConfirm () {
this.disabled = true
if (!this.pkId) {
this.disabled = false
return
}
try {
let res = await outStorageOrderConfirm(this.pkId)
if (res.code === '200') {
if (res.content.length > 0) {
this.$store.dispatch('setPublicObj', res.content[0])
uni.navigateBack()
}
} else {
uni.showToast({
title: res.msg,
icon: 'none'
})
}
this.disabled = false
} catch (e) {
this.disabled = false
}
}
}