Files
hht-tongbo-two/pages/WarehouseManage/XuniDelivery.vue
2024-05-13 17:09:27 +08:00

125 lines
3.3 KiB
Vue

<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 ref="scanChild" v-model="val1" @handleChange="handleChange1"
/>
</view>
</view>
<view class="filter_item">
<view class="filter_label_wraper">
<span class="filter_label">单据号</span>
</view>
<view class="filter_input_wraper">
<search-box v-model="val2" @handleChange="handleChange2"/>
</view>
</view>
<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>
</view>
<view class="zd_wrapper grid-wraper">
<view class="slide_new">
<table>
<thead>
<tr>
<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.bill_code === pkId, 'bgyellow': e.colro_flag === '1'}">
<td>{{e.bill_code}}</td>
<td>{{e.bill_type_name}}</td>
<td>{{e.source_bill_code}}</td>
<td>{{e.biz_date}}</td>
<td>{{e.person_name}}</td>
</tr>
</tbody>
</table>
</view>
</view>
</view>
<view class="zd-row submitbar">
<button class="zd-col-15 btn-submit btn-success letter-30" :class="{'btn-info': !pkId}" :disabled="disabled1" @tap="toSure">确认</button>
<button class="zd-col-6 btn-submit btn-success letter-30" @tap="_virtualbillQuery(val1, val2)">查询</button>
</view>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {virtualbillQuery, virtualbillType} from '@/utils/getData1.js'
export default {
components: {
NavBar,
SearchBox
},
data() {
return {
val1: '',
val2: '',
options: [],
index: '',
dataList: [],
pkId: '',
pkObj: {},
disabled1: false
};
},
created () {
this._virtualbillQuery(this.val1, this.val2)
this._virtualbillType()
},
mounted () {
this.$refs.scanChild.handleFocus()
},
methods: {
handleChange1 (e) {
this._virtualbillQuery(e, this.val2)
},
handleChange2 (e) {
this._virtualbillQuery(this.val1, e)
},
/** 选择器 */
selectChange(e) {
this.index = e
},
/** 下拉框查询 */
async _virtualbillType () {
let res = await virtualbillType()
this.options = [...res.data]
},
/** 初始化查询 */
async _virtualbillQuery (val1, val2) {
let res = await virtualbillQuery(val1, val2, this.index)
this.dataList = [...res.data]
},
toSure () {
if (this.pkId) {
uni.navigateTo({
url: '/pages/WarehouseManage/XuniDeliveryConfirm?billcode=' + this.pkObj.bill_code
})
}
},
toCheck (e) {
this.pkId = this.pkId === e.bill_code ? '' : e.bill_code
this.pkObj = this.pkId === e.bill_code ? e : {}
}
}
}
</script>