新增组盘查看、条码解绑、压制混碾满料搬运

This commit is contained in:
2024-06-24 16:18:27 +08:00
parent bb9c16fe1f
commit 32bce1af0a
4 changed files with 304 additions and 14 deletions

View File

@@ -1,15 +1,69 @@
<template>
<view>
<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-7">
<span class="filter_label">条码</span>
</view>
<view class="zd-col-17 filter_select">
<search-box
v-model="val1"
/>
</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': !val1}" :disabled="disabled" @tap="_zpxxTask">确认</button>
</view>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {zpxxTask} from '@/utils/getData2.js'
export default {
components: {
NavBar,
SearchBox
},
data() {
return {
title: '',
val1: '',
disabled: false
};
},
onLoad (options) {
this.title = options.title
},
created () {
},
methods: {
clearUp () {
this.val1 = ''
},
async _zpxxTask () {
this.disabled = true
if (!this.val1) {
this.disabled = false
return
}
try {
let res = await zpxxTask(this.val1)
this.disabled = false
uni.showToast({
title: res.message,
icon: 'none'
})
} catch (e) {
this.disabled = false
}
}
}
}
</script>

View File

@@ -1,15 +1,104 @@
<template>
<view>
<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-7">
<span class="filter_label">区域</span>
</view>
<view class="zd-col-17 filter_select">
<uni-data-select v-model="index1" :localdata="options1" @change="change"></uni-data-select>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label">点位</span>
</view>
<view class="zd-col-17 filter_select">
<uni-data-select v-model="index2" :localdata="options2"></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': !index2}" :disabled="disabled" @tap="_vehicleUnbind">解绑</button>
</view>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {vehicleUnbind} from '@/utils/getData2.js'
export default {
components: {
NavBar,
SearchBox
},
data() {
return {
title: '',
options1: [{value: 0, text: '困料区域', point: []}, {value: 1, text: '缓存货架区域', point: []}],
index1: '',
options2: [],
index2: '',
disabled: false
};
},
onLoad (options) {
this.title = options.title
},
created () {
let point1 = []
for (let i = 0; i < 56; i++) {
if (i >= 9) {
point1.push({value: `KLHW${i+1}`, text: `困料货位${i+1}`})
} else {
point1.push({value: `KLHW0${i+1}`, text: `困料货位0${i+1}`})
}
}
let point2 = []
for (let i = 0; i < 44; i++) {
if (i >= 9) {
point2.push({value: `HCHJ${i+1}`, text: `缓存货架${i+1}`})
} else {
point2.push({value: `HCHJ0${i+1}`, text: `缓存货架0${i+1}`})
}
}
this.options1[0].point = point1
this.options1[1].point = point2
},
methods: {
change (e) {
this.options1.map((el, i) => {
if (e === i) {
this.options2 = el.point
}
})
},
clearUp () {
this.index1 = ''
this.index2 = ''
},
async _vehicleUnbind () {
this.disabled = true
if (!this.index2) {
this.disabled = false
return
}
try {
let res = await vehicleUnbind(this.index2)
this.disabled = false
uni.showToast({
title: res.message,
icon: 'none'
})
} catch (e) {
this.disabled = false
}
}
}
}
</script>

View File

@@ -1,19 +1,133 @@
<template>
<view>
<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-8">
<span class="filter_label">区域</span>
</view>
<view class="zd-col-15 filter_select">
<uni-data-select v-model="index1" :localdata="options1" @change="change"></uni-data-select>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-8">
<span class="filter_label">点位</span>
</view>
<view class="zd-col-15 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-7">
<span class="filter_label">条码</span>
</view>
<view class="zd-col-17 filter_select">
<search-box
v-model="val1"
/>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label">重量</span>
</view>
<view class="zd-col-17 filter_select">
<input type="number" class="filter_input" v-model="val2">
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label">数量</span>
</view>
<view class="zd-col-17 filter_select">
<input type="number" class="filter_input" 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': !index2 || !val1 || !val2 || !val3}" :disabled="disabled" @tap="_mlTask">满料搬运</button>
</view>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {mlTask} from '@/utils/getData2.js'
export default {
components: {
NavBar,
SearchBox
},
data() {
return {
title: '',
options1: [{value: 0, text: '混碾区域', point: []}, {value: 1, text: '压制区域', point: []}],
index1: '',
options2: [],
index2: '',
val1: '',
val2: '',
val3: '',
disabled: false
};
},
onLoad (options) {
this.title = options.title
},
created () {
let point1 = []
for (let i = 0; i < 8; i++) {
point1.push({value: `HNJ0${i+1}DJW`, text: `混碾机对接位0${i+1}`})
}
let point2 = []
for (let i = 0; i < 10; i++) {
if (i >= 9) {
point2.push({value: `YJ${i+1}XLW01`, text: `压制机${i+1}下料位01`}, {value: `YJ${i+1}XLW02`, text: `压制机${i+1}下料位02`})
} else {
point2.push({value: `YJ0${i+1}XLW01`, text: `压制机0${i+1}下料位01`}, {value: `YJ0${i+1}XLW02`, text: `压制机0${i+1}下料位02`})
}
}
this.options1[0].point = point1
this.options1[1].point = point2
},
methods: {
change (e) {
this.options1.map((el, i) => {
if (e === i) {
this.options2 = el.point
}
})
},
clearUp () {
this.index1 = ''
this.index2 = ''
this.val1 = ''
this.val2 = ''
this.val3 = ''
},
async _mlTask () {
this.disabled = true
if (!this.index2 || !this.val1 || !this.val2 || !this.val3) {
this.disabled = false
return
}
try {
let res = await mlTask(this.index2, this.val1, this.val2, this.val3)
this.disabled = false
uni.showToast({
title: res.message,
icon: 'none'
})
} catch (e) {
this.disabled = false
}
}
}
}
</script>
<style lang="stylus">
</style>
</script>

View File

@@ -162,4 +162,37 @@ export const handInst = (type, id) => request({
type: type,
inst_uuid: id
}
})
/**
* 压制混碾满料搬运
*/
export const mlTask = (code, vcode, weight, qty) => request({
url:'api/pda/mlTask',
data: {
deviceCode: code,
vehicle_code: vcode,
weight: weight,
qty: qty
}
})
/**
* 条码解绑
*/
export const vehicleUnbind = (code) => request({
url:'api/pda/vehicleUnbind',
data: {
point_code: code
}
})
/**
* 组盘查看
*/
export const zpxxTask = (code) => request({
url:'api/pda/zpxxTask',
data: {
vehicle_code: code
}
})