虚拟出库父页

This commit is contained in:
2022-10-31 14:25:51 +08:00
parent 327837ee4b
commit 1847e3cde1
7 changed files with 198 additions and 70 deletions

View File

@@ -14,7 +14,7 @@
</view>
<view class="filter_item">
<view class="filter_label_wraper">
<span class="filter_label">点位</span>
<span class="filter_label">物料</span>
</view>
<view class="filter_input_wraper">
<search-box v-model="val2" />
@@ -36,7 +36,7 @@
</tr>
</thead>
<tbody>
<tr v-for="(e, i) in dataList" :key="i" @click="toCheck(e)" :class="{'checked': e.package_box_SN === pkId, 'bgyellow': e.colro_flag === '1'}">
<tr v-for="(e, i) in dataList" :key="i" :class="{'bgyellow': e.colro_flag === '1'}">
<td>{{e.package_box_SN}}</td>
<td>{{e.container_name}}</td>
<td>{{e.product_name}}</td>
@@ -51,7 +51,7 @@
</view>
</view>
<view class="submit-bar">
<button class="submit-button" :class="{'btn-disabled': !pkId}" :disabled="disabled1" @tap="_stoutConfirm">出库确认</button>
<button class="submit-button" :class="{'btn-disabled': !dataList.length}" :disabled="disabled1" @tap="_virtualoutConfirm">出库确认</button>
<button class="submit-button" @tap="_queryRawFoilList">查询</button>
</view>
</view>
@@ -60,7 +60,7 @@
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {ivtQuery, stoutConfirm, stoutPrint} from '@/utils/getData1.js'
import {virtualivtQuery, virtualoutConfirm} from '@/utils/getData1.js'
export default {
components: {
NavBar,
@@ -70,69 +70,38 @@
return {
val1: '',
val2: '',
options: [],
index: '',
billCode: '',
dataList: [],
pkId: '',
pkObj: {},
disabled1: false
};
},
created () {
this._ivtQuery()
},
onLoad (option) {
this.billCode = option.bill_code
},
methods: {
handleChange (e) {
// console.log(e)
},
/** 初始化查询 */
async _ivtQuery () {
let res = await ivtQuery(this.val1, this.val2, '0')
async _virtualivtQuery () {
let res = await virtualivtQuery(this.val1, this.val2, this.billCode)
this.dataList = [...res.data]
},
async _stoutConfirm () {
async _virtualoutConfirm () {
this.disabled1 = true
if (!this.pkId) {
this.disabled1 = false
return
}
try {
let res = await stoutConfirm(this.pkObj, '0')
let res = await virtualoutConfirm(this.dataList, this.val1)
uni.showToast({
title: res.message,
icon: 'none'
})
this.disabled1 = false
this.pkId = ''
this.pkObj = {}
this._ivtQuery()
this._virtualivtQuery()
} catch (e) {
this.disabled1 = false
}
},
async _stoutPrint () {
this.disabled1 = true
if (!this.pkId) {
this.disabled1 = false
return
}
try {
let res = await stoutPrint(this.pkObj)
uni.showToast({
title: res.message,
icon: 'none'
})
this.disabled1 = false
this.pkId = ''
this.pkObj = {}
this._ivtQuery()
} catch (e) {
this.disabled1 = false
}
},
toCheck (e) {
this.pkId = this.pkId === e.package_box_SN ? '' : e.package_box_SN
this.pkObj = this.pkId === e.package_box_SN ? e : {}
}
}
}