组盘入库

This commit is contained in:
2024-03-11 17:11:26 +08:00
parent 9bb3f00b91
commit 9a7587f80f
8 changed files with 628 additions and 102 deletions

View File

@@ -129,6 +129,11 @@ uni-button:after {
text-align: center;
color: #ff6a00;
}
.icon_right {
text-align: right;
font-size: 28rpx;
color: rgb(153, 153, 153);
}
/** 内容 */
.zd_container {
@@ -228,6 +233,9 @@ uni-button:after {
height: 100%;
overflow-y: auto;
}
.slide_h {
overflow-y: hidden;
}
.slide_new table {
table-layout: fixed;
min-width: 100%;
@@ -238,40 +246,167 @@ uni-button:after {
.slide_new table td, .slide_new table th {
box-sizing: border-box;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
white-space: nowrap;
padding: 0 20rpx;
border-bottom: 10rpx solid #f5f5f5;
text-align: center;
}
.slide_new table td:first-child, .slide_new table th:first-child{
.slide_h table td, .slide_h table th {
white-space: wrap;
padding: 0 20rpx;
border-bottom: 10rpx solid #f5f5f5;
text-align: center;
}
.slide_new table td:first-child{
position: sticky;
left: 0;
z-index: 101;
}
.slide_new table th:first-child{
position: sticky;
left: 0;
z-index: 102;
}
.slide_new table thead tr th {
position: sticky;
top: 0;
background: #d7d7d7;
font-size: 26rpx;
line-height: 98rpx;
color: #696969;
line-height: 28rpx;
padding: 35rpx 10rpx;
color: #7d7d7d;
background-color: #dcdfea;
font-weight: bold;
z-index: 100;
}
.slide_new table thead tr th:first-child {
background: #d7d7d7;
}
.slide_new table tbody tr td {
font-size: 28rpx;
line-height: 98rpx;
color: #323232;
line-height: 58rpx;
padding: 14rpx 20rpx;
color: #7d7d7d;
background: #fff;
}
.slide_h table tbody tr td {
font-size: 28rpx;
line-height: 28rpx;
padding: 14rpx 20rpx;
color: #7d7d7d;
background: #fff;
}
.slide_new table tbody tr.checked td {
background-color: #f9efb6;
color: #d09632
}
.slide_new table tbody tr td .td_input {
width: 150rpx;
font-size: 28rpx;
color: #305fbf;
line-height: 30rpx;
height: 58rpx;
padding: 14rpx;
border: 1px solid #889dc7;
box-shadow: 0 0 0 2px rgba(136, 157, 199,.2);
border-radius: 10rpx;
}
.slide_new table tbody tr td.fontcol1 {
color: #007de7;
}
.slide_new table tbody tr td.fontcol2 {
color: #000;
}
.slide_new table tbody tr td .fontbg{
font-size: 26rpx;
line-height: 30rpx;
padding: 8rpx 20rpx;
border-radius: 8rpx;
}
.slide_new table tbody tr td .fontbg1 {
background-color: #cfd2d4;
color: #5e5d5d;
}
.slide_new table tbody tr td .fontbg3 {
background-color: #96f3b8;
color: #36744c;
}
.slide_new table tbody tr td .fontbg4 {
background-color: #f3ccb5;
color: #ff5e00;
}
.item-wrapper {
width: 100%;
height: auto;
}
.item-wrap {
background-color: #fff;
border-radius: 24rpx;
padding: 22rpx 14rpx;
margin-bottom: 20rpx;
box-shadow: 0 4rpx 10rpx 2rpx rgba(0,0,0,.1);
}
.item-font-1 {
font-size: 28rpx;
color: #42444a;
line-height: 30rpx;
padding: 14rpx 4rpx;
}
.item-font-2 {
font-size: 26rpx;
color: #2b87ff;
line-height: 30rpx;
padding: 14rpx 4rpx;
background-color: #edf6ff;
border-radius: 10rpx;
text-align: center;
}
.item-font-3 {
font-size: 26rpx;
color: #ff8824;
line-height: 30rpx;
padding: 14rpx 4rpx;
background-color: #fff4ea;
border-radius: 10rpx;
text-align: center;
}
.item-font-4 {
font-size: 26rpx;
color: #c1c1c3;
line-height: 30rpx;
padding: 14rpx 4rpx;
}
.item-status {
font-size: 26rpx;
color: #fff;
line-height: 30rpx;
padding: 6rpx 1rpx;
background-color: #fff;
border-radius: 10rpx;
text-align: center;
}
.item-status-1 {
background-color: #cfd2d4;
color: #5e5d5d;
}
.item-status-2 {
color: #bf8836;
background-color: #f0e2cd;
}
.item-status-3 {
background-color: #f3ccb5;
color: #ff5e00;
}
.item-status-4 {
background-color: #96f3b8;
color: #36744c;
}
.item-line-1 {
height: 1rpx;
background-color: #b8b8ba;
}
.item-line-2 {
width: 1rpx;
height: 30rpx;
background-color: #000;
margin: 0 14rpx;
}
/** 提交栏 **/
@@ -375,17 +510,22 @@ uni-button:after {
}
.msg_wrapper {
position: fixed;
top: auto;
bottom: 0;
left: 0;
width: 100%;
padding: 60rpx 28rpx;
background-color: #fff;
height: calc(100% - var(--status-bar-height) - 72rpx);
box-shadow: 0 -8px 16px 0 rgba(28,31,33,.1);
border-top-left-radius: 20rpx;
border-top-right-radius: 20rpx;
z-index: 301;
transition: all .3s;
}
.msg_content {
width: 100%;
height: 100%;
overflow-y: scroll;
}
.msg_box {
width: 100%;
}

View File

@@ -50,6 +50,9 @@ input[type="button"], input[type="submit"], input[type="search"], input[type="re
.jcflexstart {
justify-content: flex-start !important;
}
.jcflexend {
justify-content: flex-end !important;
}
.zd-row {
width: 100%;

View File

@@ -88,6 +88,14 @@
}
}
,{
"path" : "pages/manage/group-in-storage",
"style" :
{
"navigationStyle": "custom"
}
}
],
"globalStyle": {
// "pageOrientation": "landscape",

View File

@@ -46,7 +46,7 @@
menuList1: [
{id: 1, title: '空托盘出库', icon: 'RF01', path: '/pages/manage/empty-tray-out'},
{id: 2, title: '空托盘入库', icon: 'RF02', path: '/pages/manage/empty-tray-in'},
{id: 3, title: '组盘入库', icon: 'RF03', path: ''},
{id: 3, title: '组盘入库', icon: 'RF03', path: '/pages/manage/group-in-storage'},
{id: 4, title: '原料出库', icon: 'RF04', path: ''},
{id: 5, title: '生产下料', icon: 'RF05', path: ''},
{id: 6, title: '点位更新', icon: 'RF06', path: ''},

View File

@@ -7,18 +7,21 @@
<view class="zd-col-5">
<span class="filter_label">载具类型</span>
</view>
<view class="zd-col-19 filter_picker">
<view class="zd-col-17 filter_picker">
<picker @change="pickerChange" :value="index1" :range="options1" range-key="text">
<view class="uni-input">{{index1 !== '' ? options1[index1].text : ''}}</view>
</picker>
</view>
<view class="uni-icons icon_right" @tap="toPhone">&#xe6b5;</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-5">
<span class="filter_label">载具编码</span>
</view>
<view class="zd-col-19">
<input type="text" class="filter_input" v-model="val2">
<search-box
v-model="val1"
/>
</view>
</view>
<view class="zd-row">
@@ -27,7 +30,7 @@
</view>
<view class="zd-col-19">
<search-box
v-model="val1"
v-model="val2"
/>
</view>
</view>
@@ -72,12 +75,12 @@
},
async _emptyInStore () {
this.disabled = true
if (!this.val1 || this.index1 === '' || !this.val2) {
if (this.index1 === '' || !this.val1 || !this.val2) {
this.disabled = false
return
}
try {
let res = await emptyInStore(this.options1[this.index1].value, this.val2, this.val1)
let res = await emptyInStore(this.options1[this.index1].value, this.val1, this.val2)
this.clearUp()
uni.showToast({
title: res.message,

View File

@@ -7,11 +7,12 @@
<view class="zd-col-5">
<span class="filter_label">载具类型</span>
</view>
<view class="zd-col-19 filter_picker">
<view class="zd-col-17 filter_picker">
<picker @change="pickerChange" :value="index1" :range="options1" range-key="text">
<view class="uni-input">{{index1 !== '' ? options1[index1].text : ''}}</view>
</picker>
</view>
<view class="uni-icons icon_right" @tap="toPhone">&#xe6b5;</view>
</view>
<!-- <view class="zd-row">
<view class="zd-col-5">

View File

@@ -0,0 +1,348 @@
<template>
<view class="zd_container">
<nav-bar title="组盘入库"></nav-bar>
<view class="zd_content">
<view class="zd_wrapper">
<view class="zd-row border-bottom">
<view class="zd-col-5">
<span class="filter_label">载具类型</span>
</view>
<view class="zd-col-17 filter_picker">
<picker @change="pickerChange" :value="index1" :range="options1" range-key="text">
<view class="uni-input">{{index1 !== '' ? options1[index1].text : ''}}</view>
</picker>
</view>
<view class="uni-icons icon_right" @tap="toPhone">&#xe6b5;</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-5">
<span class="filter_label">载具编码</span>
</view>
<view class="zd-col-19">
<search-box
v-model="val1"
/>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-5">
<span class="filter_label">物料</span>
</view>
<view class="zd-col-19 filter_select">
<zxz-uni-data-select v-model="index2" filterable :localdata="options2"></zxz-uni-data-select>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-5">
<span class="filter_label">物料数量</span>
</view>
<view class="zd-col-19">
<input type="number" class="filter_input" v-model="val2">
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-5">
<span class="filter_label">当前点位</span>
</view>
<view class="zd-col-19">
<search-box
v-model="val3"
/>
</view>
</view>
<view class="zd-row">
<view class="zd-col-5">
<span class="filter_label">是否配盘</span>
</view>
<view class="zd-col-19 zd-row jcflexend">
<switch :checked="isSwitchOn" color="#FFCC33" style="transform:scale(0.7)" @change="switch1Change"/>
</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>
<th>物料数量</th>
<th>配盘批次</th>
</tr>
</thead>
<tbody>
<tr v-for="(e, i) in dataList" :key="i" @click="toChose(e)" :class="{'checked': e.vehicle_code === pkId}">
<td class="fontcol1">{{e.vehicle_code}}</td>
<td><view class="fontbg fontbg1">{{e.vehicle_type}}</view></td>
<td class="fontcol2">{{e.material_code}}</td>
<td class="fontcol2">{{e.material_name}}</td>
<td>{{e.point_code}}</td>
<td>{{e.material_qty}}</td>
<td>{{e.pcsn}}</td>
</tr>
</tbody>
</table>
</view>
</view>
</view>
<view class="zd-row submit-bar">
<button class="zd-col-4 button-default" @tap="clearUp">清空</button>
<button class="zd-col-4 button-primary" :class="{'button-info': index1 === '' || !val1 || !val3 || !index2 || !val2}" :disabled="disabled1" @tap="_groupManual">组盘</button>
<button class="zd-col-4 button-primary" @tap="_queryVehicleGroup">配盘</button>
<button class="zd-col-4 button-primary" :class="{'button-info': !pkId}" :disabled="disabled3" @tap="_pdaPrintf">打印</button>
<button class="zd-col-4 button-primary" :class="{'button-info': !pkId}" :disabled="disabled4" @tap="_fullVehicleIn">入库</button>
</view>
<view class="zd_content msg_wrapper" :class="show ? 'popshow' : 'pophide'">
<view class="msg_content">
<view class="slide_new">
<table>
<thead>
<tr>
<th>载具编码</th>
<th>载具类型</th>
<th>物料编码</th>
<th>物料名称</th>
<th>点位</th>
<th>物料数量</th>
</tr>
</thead>
<tbody>
<tr v-for="e in dataList1" :key="e.group_id" @click="toCheck(e)" :class="{'checked': e.checked}">
<td class="fontcol1">{{e.vehicle_code}}</td>
<td><view class="fontbg fontbg1">{{e.vehicle_type}}</view></td>
<td class="fontcol2">{{e.material_code}}</td>
<td class="fontcol2">{{e.material_name}}</td>
<td>{{e.point_code}}</td>
<td>{{e.material_qty}}</td>
</tr>
</tbody>
</table>
</view>
</view>
<view class="zd-row submit-bar">
<button class="zd-col-9 button-default" @tap.stop="show = false">取消</button>
<button class="zd-col-13 button-primary" :class="{'button-info': checkArr.length === 0}" :disabled="disabled2" @tap="_groupLink">确认</button>
</view>
</view>
<view v-if="show" class="msg_mask"></view>
</view>
</template>
<script>
import {getCLodop} from "@/utils/CLodopfuncs.js"
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {getVehicleType, queryMaterial, queryExistGroup, groupManual, queryVehicleGroup, groupLink, pdaPrintf, fullVehicleIn} from '@/utils/getData2.js'
export default {
components: {
NavBar,
SearchBox
},
data() {
return {
options1: [],
index1: '',
options2: [],
index2: '',
val1: '',
val2: '',
val3: '',
isSwitchOn: false,
dataList: [],
pkId: '',
pkObj: {},
disabled1: false,
show: false,
dataList1: [],
checkArr: [],
disabled2: false,
disabled3: false,
disabled4: false
};
},
created () {
this._getVehicleType()
this._getMaterial()
this._queryExistGroup()
},
methods: {
/** 载具类型下拉框 */
async _getVehicleType () {
let res = await getVehicleType()
this.options1 = [...res]
},
pickerChange (e) {
this.index1 = e.detail.value
},
/** 物料下拉框*/
async _getMaterial (e) {
let res = await queryMaterial(e)
res.map(el => {
this.$set(el, 'value', el.material_id)
this.$set(el, 'text', el.material_name)
})
this.options2 = [...res]
},
/** 是否配盘 */
switch1Change: function (e) {
this.isSwitchOn = e.detail.value
},
/** 查询已配盘的组盘信息 */
async _queryExistGroup () {
let res = await queryExistGroup()
this.dataList = [...res]
},
/** 组盘 */
async _groupManual () {
this.disabled1 = true
if (this.index1 === '' || !this.val1 || !this.val3 || !this.index2 || !this.val2) {
this.disabled1 = false
return
}
try {
let code = ''
this.options2.map(el => {
if (el.value === this.index2) {
code = el.material_code
}
})
let res = await groupManual(this.options1[this.index1].value, this.val1, this.val3, this.index2, code, this.val2, this.isSwitchOn)
this.clearUp()
this._queryExistGroup()
uni.showToast({
title: res.message,
icon: 'none'
})
} catch (e) {
this.disabled1 = false
}
},
clearUp () {
this.index1 = ''
this.val1 = ''
this.val3 = ''
this.index2 = ''
this.val2 = ''
this.isSwitchOn = false
this.disabled1 = false
},
/** 获取待配盘信息 */
async _queryVehicleGroup () {
this.dataList1 = []
this.checkArr = []
this.disabled2 = false
let res = await queryVehicleGroup()
res.map(el => {
this.$set(el, 'checked', false)
})
this.dataList1 = [...res]
this.show = true
},
toCheck (e) {
e.checked = !e.checked
this.checkArr = this.dataList1.filter(i => { return i.checked === true })
},
/** 配盘确定 */
async _groupLink () {
this.disabled2 = true
if (this.checkArr.length === 0) {
this.disabled2 = false
return
}
try {
let res = await groupLink(this.checkArr)
this.disabled2 = false
this.show = false
uni.showToast({
title: res.message,
icon: 'none'
})
} catch (e) {
this.disabled2 = false
}
},
toChose (e) {
this.pkId = this.pkId === e.point_code ? '' : e.point_code
this.pkObj = this.pkId === e.point_code ? e : {}
},
/** 打印 */
async _pdaPrintf () {
this.disabled3 = true
if (!this.pkId) {
this.disabled3 = false
return
}
try {
let res = await pdaPrintf(this.pkObj.vehicle_code)
this.disabled3 = false
this.pkId = ''
if (JSON.stringify(res) !== '{}') {
setTimeout(this.toPrint(res), 800)
}
} catch (e) {
this.disabled3 = false
}
},
toPrint (data) {
let iparr = this.$store.getters.printUrl.split(":")
let printUrl = iparr[1].slice(2)
let LODOP = getCLodop();
if (!(LODOP.webskt && LODOP.webskt.readyState === 1)) {
uni.showToast({
title: '当前配置ip' + printUrl + '网络不通,请检查',
icon: 'none',
duration: 5000
})
return
}
LODOP.SET_SHOW_MODE('HIDE_DISBUTTIN_SETUP', 1)// 隐藏那些无效按钮
LODOP.SET_LICENSES('浙江省烟草专卖局(公司)', 'C0C4A46A3A0D1F526D426018D9F11921', '', '')
// 更换为打印服务器ip 不需要加前缀
LODOP.PRINT_INIT(null, printUrl);
// 打印机序号 规则为打印服务器打印机列表倒数从0开始 -1为默认打印机
LODOP.SET_PRINTER_INDEX(-1);
// 设置打印纸大小
LODOP.SET_PRINT_PAGESIZE(1, '80mm', '60mm', '');
LODOP.ADD_PRINT_RECT('1mm', '3mm', '74mm', '54mm', 0, 1);
LODOP.SET_PRINT_STYLE('FontSize', 12);
LODOP.SET_PRINT_STYLE('Bold', 1);
LODOP.ADD_PRINT_BARCODE('2mm', '4mm', '32mm', '32mm', 'QRCode', data.vehicle_code + '##' + data.material_code + '##' + data.material_qty + '##' + data.pcsn + '##' + data.print_time);
LODOP.ADD_PRINT_TEXT('5mm', '35mm', '50mm', '15mm', '载具编码:' + data.vehicle_code);
LODOP.ADD_PRINT_TEXT('15mm', '35mm', '50mm', '15mm', '物料编码:' + data.material_code);
LODOP.ADD_PRINT_TEXT('25mm', '35mm', '50mm', '15mm', '物料名称:' + data.material_name);
LODOP.ADD_PRINT_TEXT('34mm', '5mm', '80mm', '15mm', '物料数量:' + data.material_qty);
LODOP.ADD_PRINT_TEXT('41mm', '5mm', '80mm', '15mm', '配盘批次:' + data.pcsn);
LODOP.ADD_PRINT_TEXT('48mm', '5mm', '80mm', '15mm', '打印时间:' + data.print_time);
LODOP.PRINT(); // 打印
// LODOP.PREVIEW()
uni.showToast({
title: '打印成功',
icon: 'none'
})
},
/** 入库 */
async _fullVehicleIn () {
this.disabled4 = true
if (!this.pkId) {
this.disabled4 = false
return
}
try {
let res = await fullVehicleIn(this.pkId)
this.disabled4 = false
this.pkId = ''
this._queryExistGroup()
} catch (e) {
this.disabled4 = false
}
}
}
}
</script>
<style lang="stylus">
@import '../../common/style/mixin.styl';
</style>

View File

@@ -66,6 +66,111 @@ export const emptyInStore = (type, vcode, code) => request({
point_code: code
}
})
/**
* 组盘入库
*/
// 1.1获取物料信息
// export const queryMaterial = () => request({
// url:'api/pda/queryMaterial',
// data: {}
// })
export const queryMaterial = () => {
let res = [
{
"material_id": "19",
"material_code": "2",
"material_name": "a1"
},
{
"material_id": "9",
"material_code": "4",
"material_name": "b1"
}
]
return res
}
// 查询已配盘的组盘信息
// export const queryExistGroup = () => request({
// url:'api/pda/queryExistGroup',
// data: {}
// })
export const queryExistGroup = () => {
let res = [
{
"vehicle_code": "6",
"vehicle_type": "in ea",
"material_id": "83",
"material_code": "75",
"material_name": "式历委至统",
"point_code": "76",
"material_qty": "Ut ea veniam officia in",
"pcsn": "consequat enim proident labore"
}
]
return res
}
// 组盘
export const groupManual = (vtype, vcode, pcode, mid, mcode, qty, isl) => request({
url:'api/pda/group/manual',
data: {
vehicle_type: vtype,
vehicle_code: vcode,
point_code: pcode,
material_id: mid,
material_code: mcode,
material_qty: qty,
is_link: isl
}
})
//获取待配盘信息
// export const queryVehicleGroup = () => request({
// url:'api/pda/queryVehicleGroup',
// data: {}
// })
export const queryVehicleGroup = () => {
let res = [
{
"group_id": "30",
"vehicle_type": "in quis magna veniam",
"vehicle_code": "91",
"material_id": "4",
"material_code": "20",
"material_name": "张认义关金",
"point_code": "16"
}
]
return res
}
// 开始配盘
export const groupLink = (arr) => request({
url:'api/pda/group/link',
data: arr
})
// 打印
export const pdaPrintf = (code) => request({
url:'api/pda/printf',
data: {
vehicle_code: code
}
})
// export const pdaPrintf = (code) => {
// let res = {
// "vehicle_code": "91",
// "material_code": "20",
// "material_name": "张认义关金",
// "material_qty": "100",
// "pcsn": "20201112",
// "print_time": "20240210"
// }
// return res
// }
//入库
export const fullVehicleIn = (code) => request({
url:'api/pda/fullVehicleIn',
data: {
point_code: code
}
})
/**
* 任务流转
*/
@@ -136,13 +241,7 @@ export const queryPoints = (type) => request({
// return res
// }
//1.3满托入库
export const fullVehicleIn = (code) => request({
url:'api/pda/fullVehicleIn',
data: {
point_code: code
}
})
/**
* 原材料库出库
@@ -196,79 +295,3 @@ export const fullVehicleOutConfirm = (code, vcode, num) => request({
}
})
// 1.2获取物料信息
export const queryMaterial = () => request({
url:'api/pda/queryMaterial',
data: {}
})
// export const queryMaterial = () => {
// let res = [
// {
// "material_id": "19",
// "material_code": "24",
// "material_name": "从非酸地次属例"
// },
// {
// "material_id": "9",
// "material_code": "24",
// "material_name": "从非酸地次属例"
// }
// ]
// return res
// }
//1.3获取组盘中状态的组盘信息
export const queryVehicleGroup = () => request({
url:'api/pda/queryVehicleGroup',
data: {}
})
// export const queryVehicleGroup = () => {
// let res = [
// {
// "group_id": "30",
// "vehicle_type": "in quis magna veniam",
// "vehicle_code": "91",
// "material_id": "4",
// "material_code": "20",
// "material_name": "张认义关金",
// "point_code": "16"
// }
// ]
// return res
// }
// 开始组盘
export const groupManual = (vtype, vcode, pcode, mid, mcode, qty, isl) => request({
url:'api/pda/group/manual',
data: {
vehicle_type: vtype,
vehicle_code: vcode,
point_code: pcode,
material_id: mid,
material_code: mcode,
material_qty: qty,
is_link: isl
}
})
// 开始配盘
export const groupLink = (arr) => request({
url:'api/pda/group/link',
data: arr
})
// 打印标签
export const pdaPrintf = (code) => request({
url:'api/pda/printf',
data: {
vehicle_code: code
}
})
// export const pdaPrintf = (code) => {
// let res = {
// "vehicle_code": "91",
// "material_code": "20",
// "material_name": "张认义关金",
// "material_qty": "100",
// "pcsn": "20201112",
// "print_time": "20240210"
// }
// return res
// }