单据出库修改

This commit is contained in:
蔡玲
2024-12-04 13:09:03 +08:00
parent cb632a8b30
commit 69e5f4f116
3 changed files with 35 additions and 28 deletions

View File

@@ -56,7 +56,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}" :disabled="disabled" @tap="_outStorageOrderConfirm">确认</button>
<button class="zd-col-16 button-primary" :class="{'button-info': !pkId}" @tap="toSure">确认</button>
</view>
</view>
</template>
@@ -64,7 +64,7 @@
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {outStorageOrderList, outStorageOrderConfirm} from '@/utils/getData2.js'
import {outStorageOrderList} from '@/utils/getData2.js'
export default {
components: {
NavBar,
@@ -77,6 +77,7 @@
code: '',
dataList: [],
pkId: '',
pkObj: {},
disabled: false,
reload: false,
status: 'more',
@@ -140,29 +141,12 @@
},
toChek (e) {
this.pkId = this.pkId === e.code ? '' : e.code
this.pkObj = this.pkId === e.code ? e : {}
},
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
toSure () {
if (this.pkId) {
this.$store.dispatch('setPublicObj', this.pkObj)
uni.navigateBack()
}
}
}