This commit is contained in:
2025-09-08 15:41:33 +08:00
parent c41a17952b
commit d7667fac02
10 changed files with 628 additions and 718 deletions

View File

@@ -9,7 +9,7 @@
<span class="filter_label">载具编码</span>
</view>
<view class="zd-col-18">
<search-box v-model="code1"/>
<search-box v-model="vehicleCode" @handleChange="handleChange"/>
</view>
</view>
<view class="zd-row border-bottom">
@@ -17,7 +17,7 @@
<span class="filter_label">所属机台</span>
</view>
<view class="zd-col-13">
<input type="text" class="filter_input">
<input type="text" v-model="deviceData.device_code" class="filter_input">
</view>
<button class="mini-btn" type="primary" size="mini" @tap="toJump('machine-order?title=机台工单维护')">查询</button>
</view>
@@ -26,7 +26,7 @@
<span class="filter_label filter_input_disabled">工单</span>
</view>
<view class="zd-col-18">
<input type="text" class="filter_input filter_input_disabled" disabled>
<input type="text" v-model="deviceData.bom_code" class="filter_input filter_input_disabled" disabled>
</view>
</view>
<view class="zd-row border-bottom">
@@ -34,7 +34,7 @@
<span class="filter_label">物料编码</span>
</view>
<view class="zd-col-18">
<search-box v-model="code2"/>
<search-box v-model="materialInfo"/>
</view>
</view>
<view class="zd-row border-bottom">
@@ -42,7 +42,7 @@
<span class="filter_label">重量</span>
</view>
<view class="zd-col-16">
<input type="number" class="filter_input">
<input type="number" v-model="qty" class="filter_input">
</view>
<view class="zd-col-2"><span class="filter_unit">KG</span></view>
</view>
@@ -71,13 +71,18 @@
<tbody>
<tr v-for="(e, i) in dataList" :key="i">
<td>{{i+1}}</td>
<td>{{e.source_form_type}}</td>
<td>{{e.source_form_date}}</td>
<td>{{e.material_code}}</td>
<td>{{e.material_spec}}</td>
<td>{{e.material_name}}</td>
<td>{{e.pcsn}}</td>
<td>{{e.assign_qty}}</td>
<td>{{e.qty}}</td>
<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>
<td>{{['待检', '合格', '不合格'][Number(e.quality_type) - 1]}}</td>
<td>{{e.bake_num}}</td>
</tr>
</tbody>
</table>
@@ -86,7 +91,7 @@
</view>
<view class="zd-row submit-bar">
<button class="zd-col-5 button-default" @tap="toEmpty">清空</button>
<button class="zd-col-18 button-primary" :class="{'button-info': !code1}" :disabled="disabled">确认组箱</button>
<button class="zd-col-18 button-primary" :class="{'button-info': JSON.stringify(deviceData) === '{}' || (!materialInfo && qty) || (materialInfo && !qty)}" :disabled="disabled" @tap="_deliveryBox">确认组箱</button>
</view>
</view>
</template>
@@ -94,7 +99,8 @@
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {getStructCount, inStorageOrder, getBillNoInfo, storList, inStorageConfirm} from '@/utils/getData2.js'
import {queryGroupInfo} from '@/utils/mork2.js'
import {deliveryBox} from '@/utils/getData2.js'
export default {
components: {
NavBar,
@@ -103,11 +109,10 @@
data() {
return {
title: '',
code1: '',
code2: '',
code3: '',
options: [],
index: '',
vehicleCode: '',
deviceData: {},
materialInfo: '',
qty: '',
dataList: [],
disabled: false
};
@@ -115,41 +120,57 @@
onLoad (options) {
this.title = options.title
},
onShow () {
if (this.$store.getters.publicObj !== '') {
this.deviceData = this.$store.getters.publicObj
this.$store.dispatch('setPublicObj', '')
}
},
methods: {
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 = []
}
},
toJump (name) {
uni.navigateTo({
url: `/pages/General/${name}`
})
},
/** 下拉框*/
async _inStorageOrder () {
let res = await inStorageOrder()
this.options1 = [...res]
},
handleChange1 (e) {
if (e) {
this._getBillNoInfo(e)
}
},
toEmpty () {
this.code1 = ''
this.vehicleCode = ''
this.deviceData = {}
this.materialInfo = ''
this.qty = ''
this.dataList = []
},
async _inStorageConfirm () {
async _deliveryBox () {
this.disabled = true
if (!this.index) {
if (JSON.stringify(this.deviceData) === '{}' || (!this.materialInfo && this.qty) || (this.materialInfo && !this.qty)) {
this.disabled = false
return
}
try {
let res = await inStorageConfirm()
if (res.code === '200') {
this.index = ''
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'
})
}
this.disabled = false
uni.showToast({
title: res.msg,
icon: 'none'
})
} catch (e) {
this.disabled = false
}