拣选作业修改

This commit is contained in:
蔡玲
2024-11-13 16:14:58 +08:00
parent 52b8cab3f7
commit f0cf644d5f
3 changed files with 76 additions and 78 deletions

View File

@@ -5,114 +5,90 @@
<view class="zd_content">
<view class="zd_wrapper">
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label">拣选单据</span>
</view>
<view class="zd-col-24">
<input type="text" class="filter_input" @click="toJump" v-model="data.code">
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-7">
<view class="zd-col-8">
<span class="filter_label">料箱编码</span>
</view>
<view class="zd-col-24">
<input type="text" class="filter_input" v-model="data.vehicle_code">
<view class="zd-col-16">
<search-box
v-model="val1"
@handleChange="handleChange"
/>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-7">
<view class="zd-row border-bottom filter_input_disabled">
<view class="zd-col-8">
<span class="filter_label">拣选单据</span>
</view>
<view class="zd-col-16">
<input type="text" class="filter_input" v-model="data.code" disabled>
</view>
</view>
<view class="zd-row border-bottom filter_input_disabled">
<view class="zd-col-8">
<span class="filter_label">车间</span>
</view>
<view class="zd-col-24">
<input type="text" class="filter_input" v-model="data.product_area">
<view class="zd-col-16">
<input type="text" class="filter_input" v-model="data.product_area" disabled>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-7">
<view class="zd-row border-bottom filter_input_disabled">
<view class="zd-col-8">
<span class="filter_label">拣选仓库</span>
</view>
<view class="zd-col-24">
<input type="text" class="filter_input" v-model="data.stor_code">
<view class="zd-col-16">
<input type="text" class="filter_input" v-model="data.stor_code" disabled>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-7">
<view class="zd-row border-bottom filter_input_disabled">
<view class="zd-col-8">
<span class="filter_label">拣选站台</span>
</view>
<view class="zd-col-24">
<input type="text" class="filter_input" v-model="data.point_code">
<view class="zd-col-16">
<input type="text" class="filter_input" v-model="data.point_code" disabled>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label">物料名称</span>
</view>
<view class="zd-col-24">
<input type="text" class="filter_input" v-model="data.material_name">
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label">物料数量</span>
</view>
<view class="zd-col-24">
<input type="text" class="filter_input" v-model="data.qty">
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-7">
<view class="zd-row border-bottom filter_input_disabled">
<view class="zd-col-8">
<span class="filter_label">拣选数量</span>
</view>
<view class="zd-col-24">
<input type="text" class="filter_input" v-model="data.assign_qty">
<view class="zd-col-16">
<input type="number" class="filter_input" v-model="data.qty" disabled>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-7">
<view class="zd-col-8">
<span class="filter_label">移出料箱</span>
</view>
<view class="zd-col-24">
<input type="text" class="filter_input" v-model="data.out_pick_vehicle">
<view class="zd-col-16">
<search-box
v-model="val2"
/>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label">移出数量</span>
<view class="zd-col-8">
<span class="filter_label">是否机械搬运</span>
</view>
<view class="zd-col-24">
<input type="text" class="filter_input" v-model="data.out_qty">
<view class="relative zd-col-16">
<switch :checked="isChecked" color="#4e6ef2" style="transform:scale(0.8)"/>
<text @tap="setWStatus" style="position: absolute;display: inline-block;width: 52px; height: 32px;left: 0;"></text>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label">是否人工搬运</span>
</view>
<view class="zd-col-24">
<input type="text" class="filter_input" v-model="data.is_move">
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-7">
<view class="zd-col-8">
<span class="filter_label">移入料箱</span>
</view>
<view class="zd-col-24">
<input type="text" class="filter_input" v-model="data.in_pick_vehicle">
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label">移入数量</span>
</view>
<view class="zd-col-24">
<input type="text" class="filter_input" v-model="data.in_qty">
<view class="zd-col-16">
<search-box
v-model="val3"
/>
</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': JSON.stringify(data) === '{}'}" :disabled="disabled" @tap="_savePickTask">拣选确认</button>
<button class="zd-col-15 button-primary" :class="{'button-info': !val1|| !val2 || !val3}" :disabled="disabled" @tap="_savePickTask">拣选确认</button>
</view>
</view>
</template>
@@ -120,7 +96,7 @@
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {savePickTask} from '@/utils/getData2.js'
import {queryPick, savePickTask} from '@/utils/getData2.js'
export default {
components: {
NavBar,
@@ -128,6 +104,10 @@
},
data() {
return {
val1: '',
val2: '',
val3: '',
isChecked: true,
data: {},
disabled: false
};
@@ -141,23 +121,33 @@
}
},
methods: {
toJump () {
uni.navigateTo({
url: '/pages/pick/pick-list?title=拣选单列表'
})
handleChange (e) {
this._queryPick(e)
},
async _queryPick (e) {
let res = await queryPick('Picking', e)
this.data = res
},
setWStatus () {
this.isChecked = !this.isChecked
},
clearUp () {
this.data = {}
this.val1 = ''
this.val2 = ''
this.val3 = ''
this.isChecked = true
this.disabled = false
},
async _savePickTask () {
this.disabled = true
if (JSON.stringify(this.data) === '{}') {
if (!this.val1|| !this.val2 || !this.val3) {
this.disabled = false
return
}
try {
let res = await savePickTask(this.data)
let obj = Object.assign({}, this.data, {is_move: this.isChecked, pick_vehicle_23: this.val2, pick_vehicle_13: this.val3})
let res = await savePickTask(obj)
if (res.code === '200') {
uni.showToast({
title: res.msg,