Files
hht-hengsen-uni/pages/pick/pick-task.vue

189 lines
5.4 KiB
Vue
Raw Normal View History

2024-07-22 17:32:37 +08:00
<template>
2024-08-02 17:26:50 +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">
2025-03-20 11:29:13 +08:00
<view class="zd-col-10">
2024-11-13 16:14:58 +08:00
<span class="filter_label">料箱编码</span>
2024-08-02 17:26:50 +08:00
</view>
2025-03-20 11:29:13 +08:00
<view class="zd-col-14">
2024-11-13 16:14:58 +08:00
<search-box
v-model="val1"
@handleChange="handleChange"
/>
2024-08-02 17:26:50 +08:00
</view>
</view>
2024-11-13 16:14:58 +08:00
<view class="zd-row border-bottom filter_input_disabled">
2025-03-20 11:29:13 +08:00
<view class="zd-col-10">
2024-11-13 16:14:58 +08:00
<span class="filter_label">拣选单据</span>
2024-08-09 13:53:23 +08:00
</view>
2025-03-20 11:29:13 +08:00
<view class="zd-col-14">
2024-11-13 16:14:58 +08:00
<input type="text" class="filter_input" v-model="data.code" disabled>
2024-08-09 13:53:23 +08:00
</view>
</view>
2024-11-13 16:14:58 +08:00
<view class="zd-row border-bottom filter_input_disabled">
2025-03-20 11:29:13 +08:00
<view class="zd-col-10">
2024-08-09 13:53:23 +08:00
<span class="filter_label">车间</span>
</view>
2025-03-20 11:29:13 +08:00
<view class="zd-col-14">
2024-11-13 16:14:58 +08:00
<input type="text" class="filter_input" v-model="data.product_area" disabled>
2024-08-09 13:53:23 +08:00
</view>
</view>
2024-11-13 16:14:58 +08:00
<view class="zd-row border-bottom filter_input_disabled">
2025-03-20 11:29:13 +08:00
<view class="zd-col-10">
2024-08-09 13:53:23 +08:00
<span class="filter_label">拣选仓库</span>
</view>
2025-03-20 11:29:13 +08:00
<view class="zd-col-14">
2024-11-13 16:14:58 +08:00
<input type="text" class="filter_input" v-model="data.stor_code" disabled>
2024-08-09 13:53:23 +08:00
</view>
</view>
2024-11-13 16:14:58 +08:00
<view class="zd-row border-bottom filter_input_disabled">
2025-03-20 11:29:13 +08:00
<view class="zd-col-10">
2024-08-09 13:53:23 +08:00
<span class="filter_label">拣选站台</span>
</view>
2025-03-20 11:29:13 +08:00
<view class="zd-col-14">
2024-11-13 16:14:58 +08:00
<input type="text" class="filter_input" v-model="data.point_code" disabled>
2024-08-02 17:26:50 +08:00
</view>
</view>
2024-11-13 16:14:58 +08:00
<view class="zd-row border-bottom filter_input_disabled">
2025-03-20 11:29:13 +08:00
<view class="zd-col-10">
2024-08-09 13:53:23 +08:00
<span class="filter_label">拣选数量</span>
</view>
2025-03-20 11:29:13 +08:00
<view class="zd-col-14">
2024-11-13 16:14:58 +08:00
<input type="number" class="filter_input" v-model="data.qty" disabled>
2024-08-09 13:53:23 +08:00
</view>
</view>
<view class="zd-row border-bottom">
2025-03-20 11:29:13 +08:00
<view class="zd-col-10">
<span class="filter_label">出库至二楼料箱</span>
2024-08-09 13:53:23 +08:00
</view>
2025-03-20 11:29:13 +08:00
<view class="zd-col-14">
2024-11-13 16:14:58 +08:00
<search-box
v-model="val2"
/>
2024-08-09 13:53:23 +08:00
</view>
</view>
<view class="zd-row border-bottom">
2025-03-20 11:29:13 +08:00
<view class="zd-col-10">
2024-11-13 16:14:58 +08:00
<span class="filter_label">是否机械搬运</span>
2024-08-09 13:53:23 +08:00
</view>
2025-03-20 11:29:13 +08:00
<view class="relative zd-col-14">
<switch :checked="isChecked" color="#4e6ef2" style="transform:scale(0.8); transform-origin: left;"/>
2024-11-13 16:14:58 +08:00
<text @tap="setWStatus" style="position: absolute;display: inline-block;width: 52px; height: 32px;left: 0;"></text>
2024-08-09 13:53:23 +08:00
</view>
</view>
<view class="zd-row border-bottom">
2025-03-20 11:29:13 +08:00
<view class="zd-col-10">
<span class="filter_label">返回至立库料箱</span>
2024-08-09 13:53:23 +08:00
</view>
2025-03-20 11:29:13 +08:00
<view class="zd-col-14">
2024-11-13 16:14:58 +08:00
<search-box
v-model="val3"
/>
2024-08-02 17:26:50 +08:00
</view>
</view>
</view>
</view>
<view class="zd-row submit-bar">
<button class="zd-col-6 button-default" @tap="clearUp">清空</button>
2025-03-20 11:29:13 +08:00
<button class="zd-col-16 button-primary" :class="{'button-info': !val1|| !val2 || !val3}" :disabled="disabled" @tap="toSure">拣选确认</button>
2024-08-02 17:26:50 +08:00
</view>
2025-03-20 11:29:13 +08:00
<view class="zd_content msg_wrapper" :class="show ? 'popshow' : 'pophide'">
<view class="pop-line"></view>
<view class="msg_content">
<view class="zd-row border-bottom">
<view class="zd-col-10 filter_label">出库二楼料箱号为</view>
<view class="zd-col-14 font-size-1">{{val2}}</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-10 filter_label">返回立库料箱号为</view>
<view class="zd-col-14 font-size-1">{{val3}}</view>
</view>
<view class="filter_label">是否确认</view>
</view>
<view class="zd-row submit-bar">
<button class="zd-col-11 button-default" @tap.stop="show = false;disabled = false">关闭</button>
<button class="zd-col-11 button-primary" :disabled="disabled" @tap="_savePickTask">确定</button>
</view>
</view>
<view v-if="show" class="msg_mask"></view>
2024-07-22 17:32:37 +08:00
</view>
</template>
<script>
2024-08-02 17:26:50 +08:00
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
2024-11-13 16:14:58 +08:00
import {queryPick, savePickTask} from '@/utils/getData2.js'
2024-07-22 17:32:37 +08:00
export default {
2024-08-02 17:26:50 +08:00
components: {
NavBar,
SearchBox
},
2024-07-22 17:32:37 +08:00
data() {
return {
2024-11-13 16:14:58 +08:00
val1: '',
val2: '',
val3: '',
isChecked: true,
2024-08-09 13:53:23 +08:00
data: {},
2025-03-20 11:29:13 +08:00
disabled: false,
show: false
2024-07-22 17:32:37 +08:00
};
2024-08-02 17:26:50 +08:00
},
onLoad (options) {
this.title = options.title
},
2024-08-09 13:53:23 +08:00
onShow() {
if (this.$store.getters.publicObj !== '') {
this.data = this.$store.getters.publicObj
}
2024-08-02 17:26:50 +08:00
},
methods: {
2024-11-13 16:14:58 +08:00
handleChange (e) {
this._queryPick(e)
},
async _queryPick (e) {
let res = await queryPick('Picking', e)
this.data = res
},
setWStatus () {
this.isChecked = !this.isChecked
2024-08-02 17:26:50 +08:00
},
clearUp () {
2024-08-09 13:53:23 +08:00
this.data = {}
2024-11-13 16:14:58 +08:00
this.val1 = ''
this.val2 = ''
this.val3 = ''
this.isChecked = true
2024-08-02 17:26:50 +08:00
this.disabled = false
2025-03-21 13:23:04 +08:00
this.show = false
2024-08-02 17:26:50 +08:00
},
2025-03-20 11:29:13 +08:00
toSure () {
2024-11-13 16:14:58 +08:00
if (!this.val1|| !this.val2 || !this.val3) {
2024-08-02 17:26:50 +08:00
return
}
2025-03-20 11:29:13 +08:00
this.show = true
},
async _savePickTask () {
this.disabled = true
2024-08-02 17:26:50 +08:00
try {
2024-11-13 16:14:58 +08:00
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)
2024-08-02 17:26:50 +08:00
if (res.code === '200') {
uni.showToast({
title: res.msg,
icon: 'none'
})
this.clearUp()
} else {
this.disabled = false
}
} catch (e) {
this.disabled = false
}
}
2024-07-22 17:32:37 +08:00
}
}
2025-03-20 11:29:13 +08:00
</script>