Files
hht-tongbo/pages/ProductManage/EmptyPipeInStore.vue

146 lines
3.6 KiB
Vue
Raw Normal View History

2022-10-10 17:08:52 +08:00
<template>
2022-10-15 15:29:58 +08:00
<view class="zd_container">
2022-10-11 17:03:44 +08:00
<nav-bar title="空管入库"></nav-bar>
2022-10-15 15:29:58 +08:00
<view class="zd_content">
<view class="zd_wrapper">
2022-10-11 17:03:44 +08:00
<view class="filter_item">
<view class="filter_label_wraper">
2022-10-12 08:51:05 +08:00
<span class="filter_label">点位</span>
2022-10-11 17:03:44 +08:00
</view>
<view class="filter_input_wraper">
2022-10-12 08:51:05 +08:00
<search-box
v-model="val1"
/>
2022-10-11 17:03:44 +08:00
</view>
</view>
<view class="filter_item">
<view class="filter_label">物料</view>
<view class="filter_input_wraper">
2022-10-12 10:35:42 +08:00
<input type="text" class="filter_input" v-model="val2">
2022-10-11 17:03:44 +08:00
</view>
</view>
2022-10-12 08:51:05 +08:00
<view class="filter_item">
<view class="filter_label">区域</view>
<view class="filter_input_wraper">
<uni-data-select v-model="index" :localdata="options" @change="selectChange"></uni-data-select>
</view>
</view>
2022-10-12 10:35:42 +08:00
<view class="filter_item">
<view class="filter_label">数量</view>
<view class="filter_input_wraper">
<input type="text" class="filter_input" v-model="qty">
</view>
</view>
2022-10-11 17:03:44 +08:00
</view>
2022-10-15 15:29:58 +08:00
<view class="zd_wrapper grid-wraper">
2022-10-11 17:03:44 +08:00
<view class="slide_new">
<table>
<thead>
<tr>
2022-10-12 15:29:56 +08:00
<th>序号</th>
2022-10-12 10:35:42 +08:00
<th>点位</th>
<th>物料编码</th>
<th>物料名称</th>
<th>数量</th>
2022-10-11 17:03:44 +08:00
</tr>
</thead>
<tbody>
2022-10-12 10:35:42 +08:00
<tr v-for="(e, i) in dataList" :key="i" @click="toCheck(e)" :class="{'checked': e.point_code === pkId}">
2022-10-12 15:29:56 +08:00
<td>{{Number(i) + 1}}</td>
2022-10-12 10:35:42 +08:00
<td>{{e.point_code}}</td>
<td>{{e.material_code}}</td>
<td>{{e.material_name}}</td>
<td>{{e.qty}}</td>
2022-10-11 17:03:44 +08:00
</tr>
</tbody>
</table>
</view>
</view>
</view>
2022-10-10 19:58:07 +08:00
<view class="submit-bar">
2022-10-12 10:35:42 +08:00
<button class="submit-button" :class="{'btn-disabled': !pkId}" :disabled="disabled" @tap="_emptyConfirm">入库确认</button>
2022-10-13 16:56:47 +08:00
<button class="submit-button" @tap="_queryMaterialInfo">查询</button>
2022-10-10 19:58:07 +08:00
</view>
2022-10-10 17:08:52 +08:00
</view>
</template>
<script>
2022-10-10 19:58:07 +08:00
import NavBar from '@/components/NavBar.vue'
2022-10-12 08:51:05 +08:00
import SearchBox from '@/components/SearchBox.vue'
2022-10-12 15:29:56 +08:00
import {queryProductArea, queryMaterialInfo1, emptyConfirm} from '@/utils/getData2.js'
2022-10-10 17:08:52 +08:00
export default {
2022-10-11 17:03:44 +08:00
components: {
2022-10-12 08:51:05 +08:00
NavBar,
SearchBox
2022-10-11 17:03:44 +08:00
},
2022-10-10 17:08:52 +08:00
data() {
return {
2022-10-12 08:51:05 +08:00
val1: '',
2022-10-12 10:35:42 +08:00
val2: '',
2022-10-12 08:51:05 +08:00
options: [],
2022-10-12 10:35:42 +08:00
index: '',
qty: '',
dataList: [],
pkId: '',
2022-10-12 15:29:56 +08:00
pkObj: {},
2022-10-12 10:35:42 +08:00
disabled: false
2022-10-10 17:08:52 +08:00
};
2022-10-10 19:58:07 +08:00
},
2022-10-12 10:35:42 +08:00
created () {
2022-11-01 14:36:44 +08:00
this._queryProductArea()
this._queryMaterialInfo()
2022-10-12 10:35:42 +08:00
},
2022-10-10 19:58:07 +08:00
methods: {
2022-10-12 08:51:05 +08:00
/** 选择器 */
selectChange(e) {
this.index = e
2022-10-12 10:35:42 +08:00
},
/** 生产区域下拉框查询 */
async _queryProductArea () {
let res = await queryProductArea()
2022-10-14 09:34:25 +08:00
this.options = [...res.data]
2022-10-12 10:35:42 +08:00
},
/** 初始化查询 */
async _queryMaterialInfo () {
2022-11-01 14:35:43 +08:00
let res = await queryMaterialInfo1(this.val1, this.val2, this.index, '2')
2022-10-14 09:34:25 +08:00
this.dataList = [...res.data]
2022-10-12 10:35:42 +08:00
},
/** 确认 */
async _emptyConfirm () {
this.disabled = true
2022-10-12 15:29:56 +08:00
if (!this.pkId) {
2022-10-12 10:35:42 +08:00
this.disabled = false
return
}
try {
2022-11-01 14:35:43 +08:00
let res = await emptyConfirm(this.pkObj, this.qty, this.val1, '2')
2022-10-12 10:35:42 +08:00
this.disabled = false
2022-10-14 15:46:39 +08:00
this.pkId = ''
this.pkObj = {}
this._queryMaterialInfo()
2022-11-11 18:22:26 +08:00
uni.showToast({
title: res.message,
icon: 'none'
})
2022-10-12 10:35:42 +08:00
} catch (e) {
this.disabled = false
}
},
toCheck (e) {
2022-10-15 14:46:43 +08:00
this.pkId = this.pkId === e.point_code ? '' : e.point_code
this.pkObj = this.pkId === e.point_code ? e : {}
2022-10-12 08:51:05 +08:00
}
2022-10-10 17:08:52 +08:00
}
}
</script>
<style lang="stylus">
2022-10-12 15:29:56 +08:00
.slide_new table td:first-child, .slide_new table th:first-child
width 92rpx
.slide_new table td:nth-child(2), .slide_new table th:nth-child(2)
position sticky
2022-10-14 09:34:25 +08:00
left 89rpx
2022-10-12 15:29:56 +08:00
z-index 102
2022-10-15 14:33:05 +08:00
box-shadow 1px 0 2px rgba(0,0,0,.12)
2022-10-10 17:08:52 +08:00
</style>