托盘变更功能

master
guoshuang 2 years ago
parent 22821ba2c9
commit 3ed81cc160

@ -178,6 +178,14 @@
},
{
"path": "pages/mes/PalletChange/index",
"style": {
"navigationBarTitleText": "下机台设置",
"navigationStyle": "custom", //
"navigationBarTextStyle": "white" // white-black-
}
},
{
"path": "pages/mes/ChangePalletNew/index",
"style": {
"navigationBarTitleText": "托盘变更",
"navigationStyle": "custom", //

@ -0,0 +1,288 @@
<template>
<view class="page-product-receipt">
<view class="header" :style="{ backgroundColor: `rgba(250, 53, 52, ${scrollTop / 100})` }">
<view class="left">
<u-icon class="icon" name="arrow-left" @click="uni.navigateBack({})" />
</view>
<view class="title">托盘变更</view>
<view class="right"></view>
</view>
<u-form class="form" ref="form" label-width="180rpx">
<!-- 单号 -->
<view class="single">
<view class="single-left">
<view>rfid:</view>
<u-search placeholder="请扫描" :focus="shouciFocus" v-model="orderNo" :show-action="false" @search="query"></u-search>
</view>
<view class="single-right">
<u-button type="primary" @click="query"></u-button>
</view>
</view>
<u-form-item label="订单">
<u-input :disabled="true" v-model="orderNoItemList.orderCode" placeholder="" style="overflow: hidden" />
</u-form-item>
<!-- 机台 -->
<u-form-item label="机台">
<u-input :disabled="true" v-model="orderNoItemList.machineName" placeholder="" style="overflow: hidden" />
</u-form-item>
<!-- 产品 -->
<u-form-item label="产品">
<u-input :disabled="true" v-model="orderNoItemList.productName" placeholder="" />
</u-form-item>
<!-- 工单 -->
<u-form-item label="工单">
<u-input :disabled="true" v-model="orderNoItemList.workorderCode" placeholder="" />
</u-form-item>
<u-form-item label="缓存区:">
<jPicker sureColor="#ff0000" :moren="moren" @bindpicker="selectProductlocCode" showKey="label" valKey="value" :val="productCodelocList.value" :options="model.locList" />
</u-form-item>
<u-form-item label="库位:">
<jPicker sureColor="#ff0000" :moren="moren" @bindpicker="selectProductCode" showKey="label" valKey="value" :val="productCodeList.value" :options="model.DictList" />
</u-form-item>
<!-- <u-form-item label="托盘码:">
<u-search placeholder="请扫描托盘码" v-model="location" :show-action="false"></u-search>
</u-form-item> -->
<u-form-item label="是否取走托盘:">
<choose-one @switchfunction="switchChangeFun" :switchType="'text'" :defaultColor="'#4A72F9'" :highColor="'#FFFFFF'" :defaultValue="locationStatus" :switchList="switchListText"></choose-one>
</u-form-item>
</u-form>
<view class="bottom-bar">
<u-row class="button-bar">
<!-- 确定 -->
<u-col :span="6">
<u-button @click="onsubmit" type="primary">确定</u-button>
</u-col>
<!-- 返回 -->
<u-col :span="6">
<u-button type="error" @click="uni.navigateBack({})"></u-button>
</u-col>
</u-row>
</view>
</view>
</template>
<script lang="ts">
import { Component } from 'vue-property-decorator';
import { BasePage } from '@/components/base/page';
import model from './model';
import chooseOne from '@/components/choose-one/choose-one.vue';
import jPicker from '@/components/J-Picker/jPicker.vue';
//import { session } from '@/store/modules/session';
//import store from '@/store';
@Component({
components: {
chooseOne,
jPicker,
},
})
export default class ChangePalletNew extends BasePage {
model = model;
moren = '选择缓存区';
shouciFocus = true;
zaiciFocus = false;
switchListText = [
{
title: '是',
value: 0,
},
{
title: '否',
value: 1,
},
];
orderNoItemList: any = {};
productCodeList: any = {};
productCodelocList: any = {};
// remove: any = {};
async onReady() {
await this.model.getDictList();
//await this.model.getpalletLocation();
//this.remove = this.model.WlList[0];
}
// selectItem(e: any) {
// this.remove = e.pickerName;
// }
orderNo: any = '';
location: any = '';
locationStatus: any = 1;
async query() {
if (this.orderNo == '' || this.orderNo.length == 0) {
this.customToast('请输入nficl');
return;
}
await this.model.queryOrderNo(this.orderNo);
//console.log('???',model.orderNoItemList)
if (model.orderNoItemList == undefined) {
this.customToast('该rfid未查到数据请使用正确的rfid');
} else {
this.orderNoItemList = model.orderNoItemList;
}
//console.log('this.orderNoItemList', this.orderNoItemList);
}
generateGUID() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
var r = (Math.random() * 16) | 0,
v = c === 'x' ? r : (r & 0x3) | 0x8;
return v.toString(16);
});
}
async onsubmit() {
if (this.orderNo == '' || this.orderNo.length == 0) {
this.customToast('请输入nficl');
return;
}
var currentDate = new Date();
//
var year = currentDate.getFullYear();
var month = ('0' + (currentDate.getMonth() + 1)).slice(-2);
var day = ('0' + currentDate.getDate()).slice(-2);
var hours = ('0' + currentDate.getHours()).slice(-2);
var minutes = ('0' + currentDate.getMinutes()).slice(-2);
var seconds = ('0' + currentDate.getSeconds()).slice(-2);
// "YYYY-MM-DD HH:mm:ss"
var formattedDate = year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds;
let params = {
rfidNo: this.orderNo,
reqCode: this.generateGUID(),
reqTime: formattedDate,
sku: this.orderNoItemList.sku,
spec: this.orderNoItemList.spec,
productionState: this.orderNoItemList.productionState,
//location: this.location,
locationStatus: this.locationStatus,
location: this.productCodeList.value,
//productionState: this.productCodeList.value,
};
await this.model.palletInforUpdate(params);
if (model.SubmitCode == 10) {
this.uni.showToast({ title: '成功' });
this.Clear();
}
}
Clear() {
this.orderNo = '';
this.location = '';
this.locationStatus = -1;
this.productCodeList = {};
this.productCodelocList = {};
this.shouciFocus = false;
this.$nextTick(() => {
this.shouciFocus = true;
});
}
switchChangeFun(e) {
//console.log(e);
this.locationStatus = e.swithcSelectItem.value;
}
async selectProductCode(e: any) {
this.productCodeList = e.pickerName;
}
async selectProductlocCode(e: any) {
this.productCodelocList = e.pickerName;
await this.model.getpalletLocation(this.productCodelocList.value);
}
}
</script>
<style lang="scss" scoped>
.page-product-receipt {
background: #f2f2f2 linear-gradient(0deg, #f2f2f2 0%, #f8262c 51%, #d9001b 100%) no-repeat;
background-size: 100% 600rpx;
padding: 118rpx 30rpx 162rpx;
min-height: 100%;
.header {
position: fixed;
top: 0rpx;
left: 0;
right: 0;
z-index: 99;
display: flex;
height: 120rpx;
line-height: 88rpx;
color: #fff;
font-size: 34rpx;
font-weight: 500;
text-align: center;
padding: 45rpx 0rpx 0rpx;
.title {
flex: 3;
}
.left,
.right {
flex: 1;
}
.icon {
display: flex;
justify-content: center;
align-items: center;
width: 88rpx;
height: 88rpx;
}
}
.form {
background-color: #fff;
padding: 40rpx;
border-radius: 10rpx;
box-shadow: 0 0 20rpx 0 rgba(128, 128, 128, 0.2);
.u-form-item {
padding: 30rpx 0;
line-height: 35rpx;
.Transfer {
width: 280rpx;
height: 64rpx;
background: rgb(242, 242, 242);
border-radius: 110rpx;
}
}
.single {
width: 100%;
height: 100rpx;
display: flex;
.single-left {
width: 80%;
height: 100%;
display: flex;
view {
width: 142rpx;
height: 100%;
line-height: 100rpx;
}
}
.single-right {
button {
margin-top: 15rpx;
width: 140rpx;
height: 70rpx;
background-color: #fa3534;
}
}
}
}
.bottom-bar {
position: fixed;
bottom: 0;
left: 0;
right: 0;
z-index: 99;
background: #ffffff;
box-shadow: 0 1rpx 20rpx 0 rgba(128, 128, 128, 0.2);
padding: 20rpx;
}
::v-deep .yjy-switch-container .yjy-switch-item {
width: 100%;
}
::v-deep .yjy-switch-container {
width: 50%;
}
}
</style>

@ -0,0 +1,71 @@
import { getModule, Module, MutationAction, VuexModule } from 'vuex-module-decorators';
import store from '@/store';
import http from '@/utils/request';
import { url } from '@/utils/url';
import { session } from '@/store/modules/session';
@Module({
namespaced: true,
dynamic: true,
store,
name: 'page.mes.PalletChange',
})
export class ChangePalletNew extends VuexModule {
orderNoItemList: any = [];
@MutationAction
async queryOrderNo(orderNo: any) {
const result: any = await http.get(url.lanjumes.product.getInfoByRfid, {
//loginName: session.loginName,
params: {
factoryCode: session.FactoryCode,
rfid: orderNo,
},
});
const orderNoItemList = result.data;
return { orderNoItemList };
}
@MutationAction
async empty() {
const orderNoItemList = [];
return { orderNoItemList };
}
SubmitCode: any = '';
//托盘信息变更x
@MutationAction
async palletInforUpdate(params: any) {
const result: any = await http.post(url.lanjumes.product.palletInforUpdate, params);
const SubmitCode = result.code;
return { SubmitCode };
}
//库位下拉列表
DictList: any = [];
@MutationAction
async getpalletLocation(params) {
const result: any = await http.post(url.lanjumes.product.getpalletLocation, {
productionState: params,
});
const DictListoild: [] = result.data;
const DictList = DictListoild.map((item: any) => ({
label: item.itemName,
value: item.itemCode,
}));
return { DictList };
}
//库位下拉列表
locList: any = [];
@MutationAction
async getDictList() {
const result: any = await http.get(url.lanjumes.product.getDictList, {
params: {
productionState: 'cache',
},
});
const DictListoild: [] = result.data;
const locList = DictListoild.map((item: any) => ({
label: item.itemName,
value: item.itemCode,
}));
return { locList };
}
}
export default getModule(ChangePalletNew);

@ -266,10 +266,10 @@ export default class productCheckReceipt extends BasePage {
this.customToast('请选择是否合格');
return;
}
if (this.badMeg == '') {
this.customToast('请输入不良描述');
return;
}
// if (this.badMeg == '') {
// this.customToast('');
// return;
// }
console.log('tupian', this.imgList.join(','));
let params = {

@ -14,6 +14,7 @@ export const page = {
ProductionQtyInsp: '/pages/mes/ProductionQtyInsp/index',
ProductionQtyInsplist: '/pages/mes/ProductionQtyInsp/listdata',
ProductionQtyInspDetail: '/pages/mes/ProductionQtyInsp/detail',
ChangePalletNew: '/pages/mes/ChangePalletNew/index',
},
shouye: '/pages/shouye/index',
me: '/pages/shouye/me',

@ -25,6 +25,7 @@ export const url = {
requestDestinationStation: qianzhuione + '/mes/wcsInterface/pdaRequestDestinationStations',
getAllEquipments: qianzhuione + '/mes/pda/getAllEquipments',
saveRfidWithEquip: qianzhuione + '/mes/pda/saveRfidWithEquip',
getpalletLocation: '/api/ReceivingAndFeedingMaterials/getpalletLocation',
},
},
lanjuwms: {

Loading…
Cancel
Save