148 lines
4.2 KiB
Vue
148 lines
4.2 KiB
Vue
<template>
|
|
<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 filter_select">
|
|
<search-box
|
|
v-model="vcode"
|
|
/>
|
|
</view>
|
|
</view>
|
|
<view class="zd-row border-bottom">
|
|
<view class="zd-col-6">
|
|
<span class="filter_label">物料编码</span>
|
|
</view>
|
|
<view class="zd-col-13 filter_select">
|
|
<input type="text" class="filter_input" v-model="code">
|
|
</view>
|
|
<button class="mini-btn" type="primary" size="mini" style="margin-right: 0" @tap="_getMaterCode">查询</button>
|
|
</view>
|
|
<view class="zd-row border-bottom filter_input_disabled">
|
|
<view class="zd-col-6">
|
|
<span class="filter_label">物料名称</span>
|
|
</view>
|
|
<view class="zd-col-18 filter_select">
|
|
<input type="text" class="filter_input" v-model="initData.material_name" disabled>
|
|
</view>
|
|
</view>
|
|
<view class="zd-row border-bottom filter_input_disabled">
|
|
<view class="zd-col-6">
|
|
<span class="filter_label">物料规格</span>
|
|
</view>
|
|
<view class="zd-col-18 filter_select">
|
|
<input type="text" class="filter_input" v-model="initData.material_spec" disabled>
|
|
</view>
|
|
</view>
|
|
<view class="zd-row border-bottom">
|
|
<view class="zd-col-6">
|
|
<span class="filter_label">批次</span>
|
|
</view>
|
|
<view class="zd-col-18 filter_select">
|
|
<input type="text" class="filter_input" v-model="pcsn">
|
|
</view>
|
|
</view>
|
|
<view class="zd-row border-bottom">
|
|
<view class="zd-col-6">
|
|
<span class="filter_label">数量</span>
|
|
</view>
|
|
<view class="zd-col-18 filter_select">
|
|
<NumberInput
|
|
v-model="qty"
|
|
input-class="filter_input"
|
|
mode="mixed"
|
|
:decimalLength="6"
|
|
/>
|
|
</view>
|
|
</view>
|
|
<view class="zd-row border-bottom">
|
|
<view class="zd-col-8">
|
|
<span class="filter_label">监区</span>
|
|
</view>
|
|
<view class="zd-col-16 filter_select">
|
|
<uni-data-select v-model="index" :localdata="options"></uni-data-select>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="zd-row submit-bar">
|
|
<button class="zd-col-6 button-default" @tap="clearUp">清空</button>
|
|
<button class="zd-col-15 button-primary" :class="{'button-info': !vcode || !code || JSON.stringify(initData) === '{}' || !pcsn || !qty || !index}" :disabled="disabled" @tap="_groupPlateTwo">组盘确认</button>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import NavBar from '@/components/NavBar.vue'
|
|
import SearchBox from '@/components/SearchBox.vue'
|
|
import NumberInput from '@/components/NumberInput.vue'
|
|
import {getMaterCode, groupPlateTwo} from '@/utils/getData.js'
|
|
export default {
|
|
components: {
|
|
NavBar,
|
|
SearchBox,
|
|
NumberInput
|
|
},
|
|
data() {
|
|
return {
|
|
title: '',
|
|
vcode: '',
|
|
code: null,
|
|
initData: {},
|
|
pcsn: null,
|
|
qty: null,
|
|
index: '',
|
|
options: Array.from({length: 14}, (_, i) => i + 1).filter(num => num !== 8 && num !== 13).map(num => ({value: `A${num}`,text: `A${num}`})),
|
|
disabled: false
|
|
};
|
|
},
|
|
onLoad (options) {
|
|
this.title = options.title
|
|
},
|
|
methods: {
|
|
async _getMaterCode () {
|
|
this.initData = {}
|
|
try {
|
|
let res = await getMaterCode(this.code)
|
|
if (res && res.data) {
|
|
this.initData = res.data
|
|
}
|
|
} catch (e) {
|
|
this.initData = {}
|
|
}
|
|
},
|
|
clearUp () {
|
|
this.code = ''
|
|
this.vcode = ''
|
|
this.initData = {}
|
|
this.pcsn = null
|
|
this.qty = null
|
|
this.index = null
|
|
this.disabled = false
|
|
},
|
|
// 组盘确认
|
|
async _groupPlateTwo () {
|
|
this.disabled = true
|
|
if (!this.vcode || !this.code || JSON.stringify(this.initData) === '{}' || !this.pcsn || !this.qty || !this.index) {
|
|
this.disabled = false
|
|
return
|
|
}
|
|
try {
|
|
let res = await groupPlateTwo(this.vcode, this.code, this.initData.material_name, this.initData.material_spec, this.pcsn, this.qty, this.index)
|
|
this.clearUp()
|
|
uni.showToast({
|
|
title: res.message,
|
|
icon: 'none'
|
|
})
|
|
} catch (e) {
|
|
this.disabled = false
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script> |