单据出库修改

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()
}
}
}

View File

@@ -35,7 +35,7 @@
<view class="zd-row">
<view class="zd-col-6"><span class="filter_label">仓库</span></view>
<view class="zd-col-6 filter_select">
<uni-data-select v-model="currentData.stor_code" :localdata="options1"></uni-data-select>
<uni-data-select v-model="currentData.stor_code" :localdata="options1" @change="selectChange1"></uni-data-select>
</view>
<view class="zd-col-6"><span class="filter_label">车间</span></view>
<view class="zd-col-6 filter_select">
@@ -90,7 +90,7 @@
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {outStorageOrder, outStorageOrderList, outStorageConfirm} from '@/utils/getData2.js'
import {outStorageOrder, outStorageOrderList, outStorageConfirm, outStorageOrderConfirm} from '@/utils/getData2.js'
export default {
components: {
NavBar,
@@ -140,6 +140,29 @@
})
}
},
selectChange1 (e) {
this.currentData.stor_code = e
if (e) {
this._outStorageOrderConfirm(e)
}
},
async _outStorageOrderConfirm (e) {
try {
let res = await outStorageOrderConfirm(this.currentData.code, e)
if (res.code === '200') {
if (res.content.length > 0) {
this.currentData = res.content[0]
}
} else {
uni.showToast({
title: res.msg,
icon: 'none'
})
}
} catch (e) {
console.log(e)
}
},
handleBlur (e) {
if (e.now_assign_qty < 0 || e.now_assign_qty > e.qty) {
e.now_assign_qty = e.qty