|
|
|
@ -4,7 +4,7 @@
|
|
|
|
|
<view class="left">
|
|
|
|
|
<u-icon class="icon" name="arrow-left" @click="uni.navigateBack({})" />
|
|
|
|
|
</view>
|
|
|
|
|
<view class="title">托盘变更</view>
|
|
|
|
|
<view class="title">下机台设置</view>
|
|
|
|
|
<view class="right"></view>
|
|
|
|
|
</view>
|
|
|
|
|
<u-form class="form" ref="form" label-width="180rpx">
|
|
|
|
@ -14,25 +14,41 @@
|
|
|
|
|
<view>rfid:</view>
|
|
|
|
|
<u-search placeholder="请扫描" :focus="shouciFocus" v-model="orderNo" :show-action="false"></u-search>
|
|
|
|
|
</view>
|
|
|
|
|
<!-- <view class="single-right">
|
|
|
|
|
<u-button type="primary" @click="query">提交</u-button>
|
|
|
|
|
</view> -->
|
|
|
|
|
<view class="single-right">
|
|
|
|
|
<u-button type="primary" @click="query">查询</u-button>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<u-form-item label="托盘码:">
|
|
|
|
|
<!-- <u-form-item label="物料编码">
|
|
|
|
|
<u-input :disabled="true" v-model="model.orderNoItemList.sku" placeholder="" style="overflow: hidden" />
|
|
|
|
|
</u-form-item> -->
|
|
|
|
|
<!-- <u-form-item label="托盘码:">
|
|
|
|
|
<u-search placeholder="请扫描托盘码" v-model="location" :show-action="false"></u-search>
|
|
|
|
|
</u-form-item>
|
|
|
|
|
<u-form-item>
|
|
|
|
|
<choose-one @switchfunction="switchChangeFun" :switchType="'text'" :defaultColor="'#4A72F9'" :highColor="'#FFFFFF'" :defaultValue="locationStatus" :switchList="switchListText"></choose-one>
|
|
|
|
|
</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> -->
|
|
|
|
|
<div v-show="isshow">
|
|
|
|
|
<div v-if="oldstationNos.length">
|
|
|
|
|
<u-form-item label="设备:">
|
|
|
|
|
<jPicker sureColor="#ff0000" :moren="moren1" @bindpicker="selectProductCode" showKey="label" valKey="value" :val="productCodeList.value" :options="oldstationNos" />
|
|
|
|
|
</u-form-item>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div v-else>
|
|
|
|
|
<u-form-item label="设备类型:">
|
|
|
|
|
<jPicker sureColor="#ff0000" :moren="moren2" @bindpicker="selectProductCodeType" showKey="label" valKey="value" :val="productCodeTypeList.value" :options="DictTypeList" />
|
|
|
|
|
</u-form-item>
|
|
|
|
|
<u-form-item label="设备:">
|
|
|
|
|
<jPicker sureColor="#ff0000" :moren="moren1" @bindpicker="selectProductCode" showKey="label" valKey="value" :val="productCodeList.value" :options="DictList" />
|
|
|
|
|
</u-form-item>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</u-form>
|
|
|
|
|
<view class="bottom-bar">
|
|
|
|
|
<u-row class="button-bar">
|
|
|
|
|
<!-- 确定 -->
|
|
|
|
|
<u-col :span="6">
|
|
|
|
|
<u-button @click="query" type="primary">确定</u-button>
|
|
|
|
|
<u-button @click="onsubmit" type="primary">确定</u-button>
|
|
|
|
|
</u-col>
|
|
|
|
|
<!-- 返回 -->
|
|
|
|
|
<u-col :span="6">
|
|
|
|
@ -48,7 +64,7 @@ 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 { session } from '@/store/modules/session';
|
|
|
|
|
//import store from '@/store';
|
|
|
|
|
@Component({
|
|
|
|
|
components: {
|
|
|
|
@ -58,9 +74,14 @@ import jPicker from '@/components/J-Picker/jPicker.vue';
|
|
|
|
|
})
|
|
|
|
|
export default class PalletChange extends BasePage {
|
|
|
|
|
model = model;
|
|
|
|
|
moren = '选择缓存区';
|
|
|
|
|
moren1 = '选择设备';
|
|
|
|
|
moren2 = '选择设备类型';
|
|
|
|
|
shouciFocus = true;
|
|
|
|
|
isshow = false;
|
|
|
|
|
zaiciFocus = false;
|
|
|
|
|
DictList: any = [];
|
|
|
|
|
oldstationNos: any = [];
|
|
|
|
|
DictTypeList: any = [];
|
|
|
|
|
switchListText = [
|
|
|
|
|
{
|
|
|
|
|
title: '置为正常',
|
|
|
|
@ -72,9 +93,13 @@ export default class PalletChange extends BasePage {
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
productCodeList: any = {};
|
|
|
|
|
productCodeTypeList: any = {};
|
|
|
|
|
// remove: any = {};
|
|
|
|
|
async onReady() {
|
|
|
|
|
await this.model.getDictList();
|
|
|
|
|
await this.model.getAllEquipmentsType();
|
|
|
|
|
this.DictTypeList = model.DictTypeList;
|
|
|
|
|
await this.model.getAllEquipments();
|
|
|
|
|
this.DictList = model.DictList;
|
|
|
|
|
//this.remove = this.model.WlList[0];
|
|
|
|
|
}
|
|
|
|
|
// selectItem(e: any) {
|
|
|
|
@ -83,6 +108,27 @@ export default class PalletChange extends BasePage {
|
|
|
|
|
orderNo: any = '';
|
|
|
|
|
location: any = '';
|
|
|
|
|
locationStatus: any = -1;
|
|
|
|
|
async query() {
|
|
|
|
|
if (this.orderNo == '' || this.orderNo.length == 0) {
|
|
|
|
|
this.customToast('请输入nficl');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
this.isshow = false;
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
this.isshow = true;
|
|
|
|
|
});
|
|
|
|
|
await this.model.requestDestinationStation(this.orderNo);
|
|
|
|
|
let stationNos = model.orderNoItemList.stationNos;
|
|
|
|
|
for (let i = 0; i < stationNos.length; i++) {
|
|
|
|
|
for (let j = 0; j < this.DictList.length; j++) {
|
|
|
|
|
if (stationNos[i].stationNo === this.DictList[j].equipmentCode) {
|
|
|
|
|
stationNos[i].equipmentName = this.DictList[j].equipmentName;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.oldstationNos = stationNos;
|
|
|
|
|
}
|
|
|
|
|
generateGUID() {
|
|
|
|
|
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
|
|
|
|
var r = (Math.random() * 16) | 0,
|
|
|
|
@ -90,30 +136,32 @@ export default class PalletChange extends BasePage {
|
|
|
|
|
return v.toString(16);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
async query() {
|
|
|
|
|
async onsubmit() {
|
|
|
|
|
if (this.orderNo == '' || this.orderNo.length == 0) {
|
|
|
|
|
this.customToast('请输入nficl');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
var currentDate = new Date();
|
|
|
|
|
// 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);
|
|
|
|
|
// // 获取年份、月份、日期、小时、分钟和秒
|
|
|
|
|
// 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;
|
|
|
|
|
//var formattedDate = year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds;
|
|
|
|
|
let params = {
|
|
|
|
|
rfidNo: this.orderNo,
|
|
|
|
|
reqCode: this.generateGUID(),
|
|
|
|
|
reqTime: formattedDate,
|
|
|
|
|
location: this.location,
|
|
|
|
|
locationStatus: this.locationStatus,
|
|
|
|
|
productionState: this.productCodeList.value,
|
|
|
|
|
factoryCode: session.FactoryCode,
|
|
|
|
|
equipmentCode: this.productCodeList.value,
|
|
|
|
|
// reqCode: this.generateGUID(),
|
|
|
|
|
// reqTime: formattedDate,
|
|
|
|
|
// location: this.location,
|
|
|
|
|
// locationStatus: this.locationStatus,
|
|
|
|
|
// productionState: this.productCodeList.value,
|
|
|
|
|
};
|
|
|
|
|
await this.model.palletInforUpdate(params);
|
|
|
|
|
if (model.SubmitCode == 10) {
|
|
|
|
@ -126,6 +174,7 @@ export default class PalletChange extends BasePage {
|
|
|
|
|
this.location = '';
|
|
|
|
|
this.locationStatus = -1;
|
|
|
|
|
this.productCodeList = {};
|
|
|
|
|
this.productCodeTypeList = {};
|
|
|
|
|
this.shouciFocus = false;
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
this.shouciFocus = true;
|
|
|
|
@ -138,6 +187,15 @@ export default class PalletChange extends BasePage {
|
|
|
|
|
async selectProductCode(e: any) {
|
|
|
|
|
this.productCodeList = e.pickerName;
|
|
|
|
|
}
|
|
|
|
|
async selectProductCodeType(e: any) {
|
|
|
|
|
this.productCodeTypeList = e.pickerName;
|
|
|
|
|
let params = {
|
|
|
|
|
factoryCode: session.FactoryCode,
|
|
|
|
|
equipmentTypeCode: this.productCodeTypeList.value,
|
|
|
|
|
};
|
|
|
|
|
await this.model.getAllEquipmentsle(params);
|
|
|
|
|
this.DictList = model.seleDictList;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|