Files
hht-tongbo/pages/WarehouseManage/CustomerLabelPrint.vue

126 lines
2.8 KiB
Vue
Raw Normal View History

2022-11-22 09:46:17 +08:00
<template>
<view class="zd_container">
<nav-bar title="客户标签打印"></nav-bar>
2022-11-22 10:24:40 +08:00
<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"
2022-12-03 14:31:36 +08:00
:focused="true"
2022-11-30 12:10:49 +08:00
@handleChange="handleChange"
2022-11-22 10:24:40 +08:00
/>
</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>
<th>物料名称</th>
<th>规格</th>
<th>子卷号</th>
<th>净重</th>
<th>入库日期</th>
<th>生产日期</th>
</tr>
</thead>
<tbody>
2022-11-22 11:01:52 +08:00
<tr v-for="(e, i) in dataList" :key="i">
2022-11-22 10:24:40 +08:00
<td>{{e.package_box_sn}}</td>
<td>{{e.quanlity_in_box}}</td>
<td>{{e.box_weight}}</td>
<td>{{e.sale_order_name}}</td>
<td>{{e.product_name}}</td>
<td>{{e.product_description}}</td>
<td>{{e.width}}</td>
<td>{{e.container_name}}</td>
<td>{{e.net_weight}}</td>
<td>{{e.date_of_FG_inbound}}</td>
<td>{{e.date_of_production}}</td>
</tr>
</tbody>
</table>
</view>
</view>
</view>
<view class="submit-bar">
2022-11-22 11:01:52 +08:00
<button class="submit-button" :class="{'btn-disabled': !val1}" :disabled="disabled2" @tap="_customerPrint">打印</button>
2022-11-30 12:28:31 +08:00
<button class="submit-button" @tap="_customerInfo(val1)">查询</button>
2022-11-22 10:24:40 +08:00
</view>
2022-11-22 09:46:17 +08:00
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
2022-11-22 10:24:40 +08:00
import {customerInfo, customerPrint} from '@/utils/getData2.js'
2022-11-22 09:46:17 +08:00
export default {
components: {
NavBar,
SearchBox
},
data() {
return {
2022-11-22 10:24:40 +08:00
val1: '',
dataList: [],
disabled1: false,
2022-11-22 11:01:52 +08:00
disabled2: false
2022-11-22 09:46:17 +08:00
};
2022-11-22 10:24:40 +08:00
},
methods: {
2022-11-30 12:10:49 +08:00
handleChange (e) {
this._customerInfo(e)
},
2022-11-22 10:24:40 +08:00
/** 查询 */
2022-11-30 12:10:49 +08:00
async _customerInfo (e) {
2022-11-22 10:24:40 +08:00
if (!this.val1) {
uni.showToast({
title: '请扫木箱码',
icon: 'none'
})
return
}
2022-11-30 12:28:31 +08:00
let res = await customerInfo(e)
this.dataList = [...res.data]
2022-11-22 10:24:40 +08:00
},
/** 打印 */
async _customerPrint () {
this.disabled2 = true
2022-11-22 11:01:52 +08:00
if (!this.val1) {
2022-11-22 10:24:40 +08:00
uni.showToast({
2022-11-22 11:01:52 +08:00
title: '请扫木箱码',
2022-11-22 10:24:40 +08:00
icon: 'none'
})
this.disabled2 = false
return
}
try {
2022-11-25 08:43:55 +08:00
let res = await customerPrint(this.val1, this.$store.getters.setPrintName)
2022-11-22 10:24:40 +08:00
this.disabled2 = false
2022-11-22 11:01:52 +08:00
this.val1 = ''
2022-11-22 10:24:40 +08:00
uni.showToast({
title: res.message,
icon: 'none'
})
} catch (e) {
this.disabled2 = false
}
},
2022-11-22 09:46:17 +08:00
}
}
</script>
<style lang="stylus">
</style>