下机台设置功能

master
guoshuang 2 years ago
parent 4a64781fc9
commit ede5b46d03

@ -4,7 +4,7 @@
<view class="left"> <view class="left">
<u-icon class="icon" name="arrow-left" @click="uni.navigateBack({})" /> <u-icon class="icon" name="arrow-left" @click="uni.navigateBack({})" />
</view> </view>
<view class="title">托盘变更</view> <view class="title">下机台设置</view>
<view class="right"></view> <view class="right"></view>
</view> </view>
<u-form class="form" ref="form" label-width="180rpx"> <u-form class="form" ref="form" label-width="180rpx">
@ -14,25 +14,41 @@
<view>rfid:</view> <view>rfid:</view>
<u-search placeholder="请扫描" :focus="shouciFocus" v-model="orderNo" :show-action="false"></u-search> <u-search placeholder="请扫描" :focus="shouciFocus" v-model="orderNo" :show-action="false"></u-search>
</view> </view>
<!-- <view class="single-right"> <view class="single-right">
<u-button type="primary" @click="query"></u-button> <u-button type="primary" @click="query"></u-button>
</view> -->
</view> </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-search placeholder="请扫描托盘码" v-model="location" :show-action="false"></u-search>
</u-form-item> </u-form-item>
<u-form-item> <u-form-item>
<choose-one @switchfunction="switchChangeFun" :switchType="'text'" :defaultColor="'#4A72F9'" :highColor="'#FFFFFF'" :defaultValue="locationStatus" :switchList="switchListText"></choose-one> <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>
<u-form-item label="缓存区:"> </div>
<jPicker sureColor="#ff0000" :moren="moren" @bindpicker="selectProductCode" showKey="label" valKey="value" :val="productCodeList.value" :options="model.DictList" />
<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>
<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> </u-form>
<view class="bottom-bar"> <view class="bottom-bar">
<u-row class="button-bar"> <u-row class="button-bar">
<!-- 确定 --> <!-- 确定 -->
<u-col :span="6"> <u-col :span="6">
<u-button @click="query" type="primary">确定</u-button> <u-button @click="onsubmit" type="primary">确定</u-button>
</u-col> </u-col>
<!-- 返回 --> <!-- 返回 -->
<u-col :span="6"> <u-col :span="6">
@ -48,7 +64,7 @@ import { BasePage } from '@/components/base/page';
import model from './model'; import model from './model';
import chooseOne from '@/components/choose-one/choose-one.vue'; import chooseOne from '@/components/choose-one/choose-one.vue';
import jPicker from '@/components/J-Picker/jPicker.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'; //import store from '@/store';
@Component({ @Component({
components: { components: {
@ -58,9 +74,14 @@ import jPicker from '@/components/J-Picker/jPicker.vue';
}) })
export default class PalletChange extends BasePage { export default class PalletChange extends BasePage {
model = model; model = model;
moren = '选择缓存区'; moren1 = '选择设备';
moren2 = '选择设备类型';
shouciFocus = true; shouciFocus = true;
isshow = false;
zaiciFocus = false; zaiciFocus = false;
DictList: any = [];
oldstationNos: any = [];
DictTypeList: any = [];
switchListText = [ switchListText = [
{ {
title: '置为正常', title: '置为正常',
@ -72,9 +93,13 @@ export default class PalletChange extends BasePage {
}, },
]; ];
productCodeList: any = {}; productCodeList: any = {};
productCodeTypeList: any = {};
// remove: any = {}; // remove: any = {};
async onReady() { 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]; //this.remove = this.model.WlList[0];
} }
// selectItem(e: any) { // selectItem(e: any) {
@ -83,6 +108,27 @@ export default class PalletChange extends BasePage {
orderNo: any = ''; orderNo: any = '';
location: any = ''; location: any = '';
locationStatus: any = -1; 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() { generateGUID() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
var r = (Math.random() * 16) | 0, var r = (Math.random() * 16) | 0,
@ -90,30 +136,32 @@ export default class PalletChange extends BasePage {
return v.toString(16); return v.toString(16);
}); });
} }
async query() { async onsubmit() {
if (this.orderNo == '' || this.orderNo.length == 0) { if (this.orderNo == '' || this.orderNo.length == 0) {
this.customToast('请输入nficl'); this.customToast('请输入nficl');
return; return;
} }
var currentDate = new Date(); // var currentDate = new Date();
// // //
var year = currentDate.getFullYear(); // var year = currentDate.getFullYear();
var month = ('0' + (currentDate.getMonth() + 1)).slice(-2); // var month = ('0' + (currentDate.getMonth() + 1)).slice(-2);
var day = ('0' + currentDate.getDate()).slice(-2); // var day = ('0' + currentDate.getDate()).slice(-2);
var hours = ('0' + currentDate.getHours()).slice(-2); // var hours = ('0' + currentDate.getHours()).slice(-2);
var minutes = ('0' + currentDate.getMinutes()).slice(-2); // var minutes = ('0' + currentDate.getMinutes()).slice(-2);
var seconds = ('0' + currentDate.getSeconds()).slice(-2); // var seconds = ('0' + currentDate.getSeconds()).slice(-2);
// "YYYY-MM-DD HH:mm:ss" // "YYYY-MM-DD HH:mm:ss"
var formattedDate = year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds; //var formattedDate = year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds;
let params = { let params = {
rfidNo: this.orderNo, rfidNo: this.orderNo,
reqCode: this.generateGUID(), factoryCode: session.FactoryCode,
reqTime: formattedDate, equipmentCode: this.productCodeList.value,
location: this.location, // reqCode: this.generateGUID(),
locationStatus: this.locationStatus, // reqTime: formattedDate,
productionState: this.productCodeList.value, // location: this.location,
// locationStatus: this.locationStatus,
// productionState: this.productCodeList.value,
}; };
await this.model.palletInforUpdate(params); await this.model.palletInforUpdate(params);
if (model.SubmitCode == 10) { if (model.SubmitCode == 10) {
@ -126,6 +174,7 @@ export default class PalletChange extends BasePage {
this.location = ''; this.location = '';
this.locationStatus = -1; this.locationStatus = -1;
this.productCodeList = {}; this.productCodeList = {};
this.productCodeTypeList = {};
this.shouciFocus = false; this.shouciFocus = false;
this.$nextTick(() => { this.$nextTick(() => {
this.shouciFocus = true; this.shouciFocus = true;
@ -138,6 +187,15 @@ export default class PalletChange extends BasePage {
async selectProductCode(e: any) { async selectProductCode(e: any) {
this.productCodeList = e.pickerName; 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> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

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

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

@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/no-unused-vars */ /* 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 = { export const url = {
wmspda: { wmspda: {
system: { system: {
@ -22,6 +22,9 @@ export const url = {
sendDestinationStations: '/api/ReceivingAndFeedingMaterials/sendDestinationStations', sendDestinationStations: '/api/ReceivingAndFeedingMaterials/sendDestinationStations',
palletInforUpdate: '/api/ReceivingAndFeedingMaterials/palletInforUpdate', palletInforUpdate: '/api/ReceivingAndFeedingMaterials/palletInforUpdate',
getDictList: qianzhuione + '/quality/handCheck/getDictList', getDictList: qianzhuione + '/quality/handCheck/getDictList',
requestDestinationStation: qianzhuione + '/mes/wcsInterface/requestDestinationStations',
getAllEquipments: qianzhuione + '/mes/pda/getAllEquipments',
saveRfidWithEquip: qianzhuione + '/mes/pda/saveRfidWithEquip',
}, },
}, },
lanjuwms: { lanjuwms: {

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

Loading…
Cancel
Save