空管出入库

This commit is contained in:
2023-04-27 16:36:54 +08:00
parent 8b4396bb92
commit 5b4cad2a60
3 changed files with 154 additions and 122 deletions

View File

@@ -3,22 +3,6 @@
<nav-bar title="空管出库"></nav-bar>
<view class="zd_content">
<view class="zd_wrapper">
<view class="filter_item">
<view class="filter_label_wraper">
<span class="filter_label">点位</span>
</view>
<view class="filter_input_wraper">
<search-box
v-model="val1"
/>
</view>
</view>
<view class="filter_item">
<view class="filter_label">物料</view>
<view class="filter_input_wraper">
<input type="text" class="filter_input" v-model="val2">
</view>
</view>
<view class="filter_item">
<view class="filter_label">区域</view>
<view class="filter_input_wraper">
@@ -37,19 +21,15 @@
<table>
<thead>
<tr>
<th>序号</th>
<th>点位</th>
<th>设备</th>
<th>物料编码</th>
<th>物料名称</th>
<th>数量</th>
</tr>
</thead>
<tbody>
<tr v-for="(e, i) in dataList" :key="i" @click="toCheck(e)" :class="{'checked': e.point_code === pkId}">
<td>{{Number(i) + 1}}</td>
<td>{{e.point_code}}</td>
<tr v-for="(e, i) in dataList" :key="i" @click="toCheck(e)" :class="{'checked': e.device_code === pkId}">
<td>{{e.device_code}}</td>
<td>{{e.material_code}}</td>
<td>{{e.material_name}}</td>
<td>{{e.qty}}</td>
</tr>
</tbody>
@@ -58,8 +38,8 @@
</view>
</view>
<view class="submit-bar">
<button class="submit-button" :class="{'btn-disabled': !pkId}" :disabled="disabled" @tap="_emptyConfirm">出库确认</button>
<button class="submit-button" @tap="_queryMaterialInfo">查询</button>
<button class="submit-button" :class="{'btn-disabled': !pkId || !qty}" :disabled="disabled" @tap="_emptyConfirm">确认</button>
<button class="submit-button" @tap="_queryPaperTubeInfo">查询</button>
</view>
</view>
</template>
@@ -67,7 +47,7 @@
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {queryProductArea, queryMaterialInfo1, emptyConfirm} from '@/utils/getData2.js'
import {queryProductArea, emptyConfirm} from '@/utils/getData2.js'
export default {
components: {
NavBar,
@@ -75,8 +55,6 @@
},
data() {
return {
val1: '',
val2: '',
options: [],
index: '',
qty: '',
@@ -88,7 +66,6 @@
},
created () {
this._queryProductArea()
this._queryMaterialInfo()
},
methods: {
/** 选择器 */
@@ -101,23 +78,35 @@
this.options = [...res.data]
},
/** 初始化查询 */
async _queryMaterialInfo () {
let res = await queryMaterialInfo1(this.val1, this.val2, this.index, '1')
this.dataList = [...res.data]
async _queryPaperTubeInfo () {
let res = await queryMaterialInfo1(this.index)
this.dataList = [...res.rows]
},
/** 确认 */
async _emptyConfirm () {
this.disabled = true
if (!this.pkId) {
uni.showToast({
title: '请选择一行',
icon: 'none'
})
this.disabled = false
return
}
if (!this.qty) {
uni.showToast({
title: '请填写数量',
icon: 'none'
})
this.disabled = false
return
}
try {
let res = await emptyConfirm(this.pkObj, this.qty, this.val1, '1')
let res = await emptyConfirm(this.qty, this.pkObj.material_code, this.pkObj.device_code, '2')
this.disabled = false
this.pkId = ''
this.pkObj = {}
this._queryMaterialInfo()
this._queryPaperTubeInfo()
uni.showToast({
title: res.message,
icon: 'none'
@@ -127,8 +116,8 @@
}
},
toCheck (e) {
this.pkId = this.pkId === e.point_code ? '' : e.point_code
this.pkObj = this.pkId === e.point_code ? e : {}
this.pkId = this.pkId === e.device_code ? '' : e.device_code
this.pkObj = this.pkId === e.device_code ? e : {}
}
}
}