空载具管理

This commit is contained in:
2026-01-05 17:01:08 +08:00
parent 124f3ca87e
commit b6272f3877
22 changed files with 3451 additions and 4 deletions

View File

@@ -0,0 +1,98 @@
<template>
<view class="zd_container">
<!-- 空载具堆叠 -->
<nav-bar :title="title" :inner="true"></nav-bar>
<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 filter_select">
<search-box v-model="val1" @handleChange="handleChange"/>
</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>剩余可堆叠</th>
</tr>
</thead>
<tbody>
<tr v-for="(e, i) in dataList" :key="i" :class="{'checked': e.supp_id === pkId}" @tap="toCheck(e)">
<td>{{i+1}}</td>
<td>{{e.supp_name}}</td>
<td>{{e.remark}}</td>
<td>{{e.remark}}</td>
<td>{{e.remark}}</td>
</tr>
</tbody>
</table>
</view>
</view>
</view>
<view class="zd-row submit-bar">
<button class="zd-col-24 button-primary" :class="{'button-info': !pkId}" @tap="toSure">呼叫堆叠</button>
</view>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {querySupp} from '@/utils/getData2.js'
export default {
components: {
NavBar,
SearchBox
},
data() {
return {
title: '',
val1: '',
dataList: [],
pkId: '',
pkObj: {}
};
},
onLoad (options) {
this.title = options.title
},
methods: {
handleChange (e) {
if (e) {
this._querySupp()
}
},
async _querySupp () {
try {
let res = await querySupp(this.val1)
if (res && res.data.length > 0) {
this.dataList = [...res.data]
} else {
this.dataList = []
}
} catch (e) {
this.dataList = []
}
},
toCheck (e) {
this.pkId = this.pkId === e.supp_id ? '' : e.supp_id
this.pkObj = this.pkId === e.supp_id ? e : {}
},
toSure () {
if (this.pkId) {
this.$store.dispatch('setFormData', this.pkObj)
uni.navigateBack()
}
}
}
}
</script>

View File

@@ -0,0 +1,105 @@
<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">
<search-box v-model="val1"/>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-6">
<span class="filter_label">载具</span>
</view>
<view class="zd-col-18">
<search-box v-model="val2"/>
</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">
<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-5 button-default" @tap="toEmpty">清空</button>
<button class="zd-col-18 button-primary" :class="{'button-info': !val1 || !val2 || !index}" :disabled="disabled" @tap="_createTask">呼叫入库</button>
</view>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
// import {queryVehicleType} from '@/utils/mork2.js'
import {queryVehicleType, createTask} from '@/utils/getData2.js'
export default {
components: {
NavBar,
SearchBox
},
data() {
return {
title: '',
val1: '',
val2: '',
options: [],
index: '',
disabled: false
};
},
onLoad (options) {
this.title = options.title
this._queryVehicleType()
},
methods: {
/** 下拉框*/
async _queryVehicleType () {
try {
let res = await queryVehicleType()
if (res && res.data.length > 0) {
this.options = [...res.data]
} else {
this.options = []
}
} catch (e) {
this.options = []
}
},
toEmpty () {
this.val1 = ''
this.val2 = ''
this.index = ''
this.disabled = false
},
async _createTask () {
this.disabled = true
if (!this.val1 || !this.val2 || !this.index) {
this.disabled = false
return
}
try {
let res = await createTask(this.val1, this.val2, this.index)
if (res) {
uni.showToast({
title: res.message,
icon: 'none'
})
}
this.toEmpty()
} catch (e) {
this.disabled = false
}
}
}
}
</script>

View File

@@ -0,0 +1,126 @@
<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">
<search-box v-model="val1"/>
</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">
<uni-data-select v-model="index" :localdata="options"></uni-data-select>
</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">
<uni-data-select v-model="index2" :localdata="options2"></uni-data-select>
</view>
</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">
<input type="number" v-model="num" class="filter_input filter_input_disabled" disabled>
</view>
</view>
</view>
</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': !val1 || !index}" :disabled="disabled" @tap="_createTask">呼叫出库</button>
</view>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
// import {queryVehicleType} from '@/utils/mork2.js'
import {queryVehicleType, createTask} from '@/utils/getData2.js'
export default {
components: {
NavBar,
SearchBox
},
data() {
return {
title: '',
val1: '',
num: null,
options: [],
index: '',
options2: [{text: '原料区', value: 1}, {text: '辅料区', value: 2}, {text: '批料室', value: 3}, {text: '内包材区', value: 4}],
index2: '',
disabled: false
};
},
onLoad (options) {
this.title = options.title
this._queryVehicleType()
},
methods: {
async _queryVehicleType () {
try {
let res = await queryVehicleType()
if (res && res.data.length > 0) {
this.options = [...res.data]
} else {
this.options = []
}
} catch (e) {
this.options = []
}
},
async _queryVehicleType2 () {
try {
let res = await queryVehicleType()
if (res && res.data.length > 0) {
this.options2 = [...res.data]
} else {
this.options2 = []
}
} catch (e) {
this.options2 = []
}
},
toEmpty () {
this.val1 = ''
this.index = ''
this.index2 = ''
this.disabled = false
},
async _createTask () {
this.disabled = true
if (!this.val1 || !this.index) {
this.disabled = false
return
}
try {
let res = await createTask(this.val1, this.index)
if (res) {
uni.showToast({
title: res.message,
icon: 'none'
})
}
this.toEmpty()
} catch (e) {
this.disabled = false
}
}
}
}
</script>