Files
hht-xzhy-uni/pages/General/distribution-box.vue

184 lines
4.9 KiB
Vue
Raw Normal View History

2025-09-03 09:57:06 +08:00
<template>
2025-09-03 17:08:48 +08:00
<view class="zd_container">
<!-- 配送组箱 -->
<nav-bar :title="title"></nav-bar>
<view class="zd_content">
<view class="zd_wrapper">
<view class="zd-row border-bottom">
<view class="zd-col-6">
<span class="filter_label">载具编码</span>
</view>
<view class="zd-col-18">
2025-09-08 15:41:33 +08:00
<search-box v-model="vehicleCode" @handleChange="handleChange"/>
2025-09-03 17:08:48 +08:00
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-6">
<span class="filter_label">所属机台</span>
</view>
<view class="zd-col-13">
2025-09-08 15:41:33 +08:00
<input type="text" v-model="deviceData.device_code" class="filter_input">
2025-09-03 17:08:48 +08:00
</view>
2025-12-04 13:59:33 +08:00
<button class="mini-btn" type="primary" @tap="toJump('machine-order?title=机台工单维护')">查询</button>
2025-09-03 17:08:48 +08:00
</view>
<view class="zd-row border-bottom">
<view class="zd-col-6">
<span class="filter_label filter_input_disabled">工单</span>
</view>
<view class="zd-col-18">
2025-09-08 15:41:33 +08:00
<input type="text" v-model="deviceData.bom_code" class="filter_input filter_input_disabled" disabled>
2025-09-03 17:08:48 +08:00
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-6">
<span class="filter_label">物料编码</span>
</view>
<view class="zd-col-18">
2025-09-08 15:41:33 +08:00
<search-box v-model="materialInfo"/>
2025-09-03 17:08:48 +08:00
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-6">
<span class="filter_label">重量</span>
</view>
<view class="zd-col-16">
2025-09-16 14:48:07 +08:00
<NumberInput v-model="qty" />
2025-09-03 17:08:48 +08:00
</view>
<view class="zd-col-2"><span class="filter_unit">KG</span></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>重量(kg)</th>
<th>生产日期</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">
<td>{{i+1}}</td>
<td>{{e.material_code}}</td>
2025-09-08 15:41:33 +08:00
<td>{{e.material_name}}</td>
2025-09-03 17:08:48 +08:00
<td>{{e.pcsn}}</td>
<td>{{e.qty}}</td>
2025-09-08 15:41:33 +08:00
<td>{{e.produce_time}}</td>
<td>{{e.supp_code}}</td>
<td>{{e.supp_name}}</td>
<td>{{e.material_spec}}</td>
<td>{{e.material_model}}</td>
<td>{{e.quality_time_day}}</td>
2025-09-16 16:41:52 +08:00
<td>{{e.execution_stand}}</td>
2025-09-08 16:45:57 +08:00
<td>{{['', '待检', '合格', '不合格'][Number(e.quality_type)]}}</td>
2025-09-08 15:41:33 +08:00
<td>{{e.bake_num}}</td>
2025-09-03 17:08:48 +08:00
</tr>
</tbody>
</table>
</view>
</view>
</view>
<view class="zd-row submit-bar">
<button class="zd-col-5 button-default" @tap="toEmpty">清空</button>
2025-09-16 16:41:52 +08:00
<button class="zd-col-18 button-primary" :class="{'button-info': JSON.stringify(deviceData) === '{}'}" :disabled="disabled" @tap="_deliveryBox">确认组箱</button>
2025-09-03 17:08:48 +08:00
</view>
2025-09-03 09:57:06 +08:00
</view>
</template>
<script>
2025-09-03 17:08:48 +08:00
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
2025-09-16 14:48:07 +08:00
import NumberInput from '@/components/NumberInput.vue'
2025-09-08 16:45:57 +08:00
// import {queryGroupInfo} from '@/utils/mork2.js'
import {queryGroupInfo, deliveryBox} from '@/utils/getData2.js'
2025-09-03 09:57:06 +08:00
export default {
2025-09-03 17:08:48 +08:00
components: {
NavBar,
2025-09-16 14:48:07 +08:00
SearchBox,
NumberInput
2025-09-03 17:08:48 +08:00
},
2025-09-03 09:57:06 +08:00
data() {
return {
2025-09-03 17:08:48 +08:00
title: '',
2025-09-08 15:41:33 +08:00
vehicleCode: '',
deviceData: {},
materialInfo: '',
qty: '',
2025-09-03 17:08:48 +08:00
dataList: [],
disabled: false
2025-09-03 09:57:06 +08:00
};
2025-09-03 17:08:48 +08:00
},
onLoad (options) {
this.title = options.title
},
2025-09-08 15:41:33 +08:00
onShow () {
if (this.$store.getters.publicObj !== '') {
this.deviceData = this.$store.getters.publicObj
this.$store.dispatch('setPublicObj', '')
}
},
2025-09-03 17:08:48 +08:00
methods: {
2025-09-08 15:41:33 +08:00
handleChange (e) {
if (e) {
this._queryGroupInfo(e)
}
},
async _queryGroupInfo (e) {
try {
let res = await queryGroupInfo(e)
if (res && res.data.length > 0) {
this.dataList = [...res.data]
} else {
this.dataList = []
}
} catch (e) {
this.dataList = []
}
},
2025-09-03 17:08:48 +08:00
toJump (name) {
uni.navigateTo({
url: `/pages/General/${name}`
})
},
toEmpty () {
2025-09-08 15:41:33 +08:00
this.vehicleCode = ''
this.deviceData = {}
this.materialInfo = ''
this.qty = ''
this.dataList = []
2025-09-03 17:08:48 +08:00
},
2025-09-08 15:41:33 +08:00
async _deliveryBox () {
2025-09-03 17:08:48 +08:00
this.disabled = true
2025-09-16 16:41:52 +08:00
if (JSON.stringify(this.deviceData) === '{}') {
2025-09-03 17:08:48 +08:00
this.disabled = false
return
}
try {
2025-09-08 15:41:33 +08:00
let res = await deliveryBox(this.deviceData.device_code, this.deviceData.bom_id, this.deviceData.bom_code, this.materialInfo, this.qty, this.dataList)
if (res) {
uni.showToast({
title: res.message,
icon: 'none'
})
2025-09-03 17:08:48 +08:00
}
2025-09-18 17:22:07 +08:00
this.toEmpty()
2025-09-03 17:08:48 +08:00
this.disabled = false
} catch (e) {
this.disabled = false
}
}
2025-09-03 09:57:06 +08:00
}
}
2025-09-03 17:08:48 +08:00
</script>