新增出入库顺序表

This commit is contained in:
2024-01-23 15:52:24 +08:00
parent 57186109fe
commit fe3771a4e0
6 changed files with 193 additions and 2 deletions

View File

@@ -0,0 +1,162 @@
<template>
<view class="zd_container">
<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"
@handleChange="handleChange"
/>
</view>
</view>
</view>
<view class="zd_wrapper grid-wraper">
<view class="slide_new">
<table>
<thead>
<tr>
<th>车间</th>
<th>出入库类型</th>
<th>顺序id</th>
<th>仓库</th>
<th>入库点</th>
<th>出库点</th>
<th>箱码</th>
<th>重量</th>
<th>工单编号</th>
<th>工序</th>
<th>创建时间</th>
</tr>
</thead>
<tbody>
<tr v-for="(e, i) in dataList" :key="i" :class="{'checked': e.checked}">
<td>{{e.workshop_id}}</td>
<td>{{e.type}}</td>
<td>{{e.order_id}}</td>
<td>{{e.stor_id}}</td>
<td>{{e.in_device}}</td>
<td>{{e.out_device}}</td>
<td>{{e.bar_code}}</td>
<td>{{e.weight}}</td>
<td>{{e.workorder_id}}</td>
<td>{{e.workprocedure_id}}</td>
<td>{{e.create_time}}</td>
</tr>
</tbody>
</table>
</view>
</view>
<uni-load-more color="#007AFF" iconType="circle" :status="status" :icon-size="14" :content-text="contentText" v-if="dataList.length > 0"/>
</view>
<view class="submit-bar">
<button class="submit-button" :class="{'btn-disabled': !checkArr.length}" :disabled="disabled" @tap="toSure">强制确认</button>
<button class="submit-button" @tap="searchList">查询</button>
</view>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {hrBcpOrderList, hrBcpOrderDelete} from '@/utils/getData2.js'
export default {
components: {
NavBar,
SearchBox
},
data() {
return {
val1: '',
dataList: [],
checkArr: [],
disabled: false,
reload: false,
status: 'more',
contentText: {
contentdown: '查看更多',
contentrefresh: '加载中',
contentnomore: '没有更多'
},
totalCount: 0,
pageNum: 1,
pageSize: 30
};
},
methods: {
handleChange (e) {
this.dataList = []
this.pageNum = 1
this._hrBcpOrderList(e)
},
searchList () {
this.dataList = []
this.pageNum = 1
this._hrBcpOrderList(this.val1)
},
/** grid查询 */
async _hrBcpOrderList (e) {
let res = await hrBcpOrderList(e, this.pageNum + '', this.pageSize + '')
this.totalCount = res.totalCount
if (res.totalCount > 0) {
const dataMap = res.data
this.dataList = this.reload ? dataMap : this.dataList.concat(dataMap)
this.reload = false
} else {
this.dataList = []
}
if (this.totalCount == this.dataList.length) {
this.reload = false
this.status = 'noMore'
}
},
onReachBottom () {
if (this.totalCount > this.dataList.length) {
this.status = 'loading'
setTimeout(() => {
this.pageNum++
this._hrBcpOrderList(this.val1)
}, 1000)
} else { //停止加载
this.status = 'noMore'
}
},
toCheck (e) {
e.checked = !e.checked
this.checkArr = []
this.dataList.map(el => {
if (el.checked === true) {
this.checkArr.push(el.order_id)
}
})
},
/** 确认 */
async toSure () {
this.disabled = true
if (!this.checkArr.length) {
this.disabled = false
return
}
try {
let res = await hrBcpOrderDelete(this.checkArr)
this.disabled = false
this.dataList = []
this._hrBcpOrderList()
uni.showToast({
title: res.message,
icon: 'none'
})
} catch (e) {
this.disabled = false
}
}
}
}
</script>
<style lang="stylus">
</style>