下机台设置功能

master
guoshuang 2 years ago
parent 4a64781fc9
commit ede5b46d03

@ -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>
<u-form-item label="托盘码:">
</view>
<!-- <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> -->
<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>
<u-form-item label="缓存区:">
<jPicker sureColor="#ff0000" :moren="moren" @bindpicker="selectProductCode" showKey="label" valKey="value" :val="productCodeList.value" :options="model.DictList" />
</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>

@ -11,14 +11,13 @@ import { session } from '@/store/modules/session';
})
export class PalletChange extends VuexModule {
orderNoItemList: any = [];
//rfid查询数据
@MutationAction
async queryOrderNo(orderNo: any) {
const result: any = await http.get(url.lanjumes.product.getInfoByRfid, {
async requestDestinationStation(orderNo: any) {
const result: any = await http.post(url.lanjumes.product.requestDestinationStation, {
//loginName: session.loginName,
params: {
factoryCode: session.FactoryCode,
rfid: orderNo,
},
factory: session.FactoryCode,
rfidNo: orderNo,
});
const orderNoItemList = result.data;
return { orderNoItemList };
@ -29,29 +28,58 @@ export class PalletChange extends VuexModule {
return { orderNoItemList };
}
SubmitCode: any = '';
//托盘信息变更x
//提交接口
@MutationAction
async palletInforUpdate(params: any) {
const result: any = await http.post(url.lanjumes.product.palletInforUpdate, params);
const result: any = await http.post(url.lanjumes.product.saveRfidWithEquip, params);
const SubmitCode = result.code;
return { SubmitCode };
}
//缓存区下拉列表
DictList: any = [];
//工厂查询设备类型列表
DictTypeList: any = [];
@MutationAction
async getDictList() {
async getAllEquipmentsType() {
const result: any = await http.get(url.lanjumes.product.getDictList, {
params: {
equipmentTypeCode: 'cache',
equipmentTypeCode: 'equ_type',
},
});
const DictTypeListoild: [] = result.data;
const DictTypeList = DictTypeListoild.map((item: any) => ({
label: item.itemName,
value: item.itemCode,
...item,
}));
return { DictTypeList };
}
//工厂查询设备列表
DictList: any = [];
@MutationAction
async getAllEquipments() {
const result: any = await http.post(url.lanjumes.product.getAllEquipments, {
factoryCode: session.FactoryCode,
});
const DictListoild: [] = result.data;
const DictList = DictListoild.map((item: any) => ({
label: item.itemName,
value: item.itemCode,
label: item.equipmentName,
value: item.equipmentCode,
...item,
}));
return { DictList };
}
//工厂根据设备类型查询设备列表
seleDictList: any = [];
@MutationAction
async getAllEquipmentsle(params: any) {
const result: any = await http.post(url.lanjumes.product.getAllEquipments, params);
const DictListoild: [] = result.data;
const seleDictList = DictListoild.map((item: any) => ({
label: item.equipmentName,
value: item.equipmentCode,
...item,
}));
return { seleDictList };
}
}
export default getModule(PalletChange);

@ -84,8 +84,8 @@ http.interceptors.response.use(
} else if (code !== undefined) {
// 有 code 代表这是一个后端接口 可以进行进一步的判断
switch (code) {
// case '0':
// return dataAxios;
case null:
return dataAxios;
case '1':
// code === '1' 代表没有错误
return dataAxios;

@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
const qianzhuione = '/prod-api'; // '/prod-api'生产环境 // '/dev-api'开发环境是调后端本地时使用
const qianzhuione = '/dev-api'; // '/prod-api'生产环境 // '/dev-api'开发环境是调后端本地时使用
export const url = {
wmspda: {
system: {
@ -22,6 +22,9 @@ export const url = {
sendDestinationStations: '/api/ReceivingAndFeedingMaterials/sendDestinationStations',
palletInforUpdate: '/api/ReceivingAndFeedingMaterials/palletInforUpdate',
getDictList: qianzhuione + '/quality/handCheck/getDictList',
requestDestinationStation: qianzhuione + '/mes/wcsInterface/requestDestinationStations',
getAllEquipments: qianzhuione + '/mes/pda/getAllEquipments',
saveRfidWithEquip: qianzhuione + '/mes/pda/saveRfidWithEquip',
},
},
lanjuwms: {

@ -10,12 +10,12 @@ module.exports = {
// },
},
'/dev-api': {
target: 'http://192.168.3.93:81',
//target: 'http://192.168.202.20:9000',
target: 'http://192.168.3.93:8080',
//target: 'http://192.168.3.231:8080',
changeOrigin: true,
// pathRewrite: {
// '^/dev-api': '',
// },
pathRewrite: {
'^/dev-api': '',
},
},
'/api': {
//target: 'http://192.168.3.93:81',

Loading…
Cancel
Save