货架送回 新增部分
This commit is contained in:
@ -20,7 +20,7 @@
|
|||||||
</navigator>
|
</navigator>
|
||||||
</view>
|
</view>
|
||||||
<view class="uni-flex uni-column" style="flex: 5;">
|
<view class="uni-flex uni-column" style="flex: 5;">
|
||||||
<navigator url="../bind/bind" hover-class="navigator-hover">
|
<navigator url="../queryBindList/queryBindList" hover-class="navigator-hover">
|
||||||
<view class="uni-flex uni-row" style="-webkit-justify-content: center;justify-content: center;">
|
<view class="uni-flex uni-row" style="-webkit-justify-content: center;justify-content: center;">
|
||||||
<image class="function-image" src="/static/bindQuery.png" />
|
<image class="function-image" src="/static/bindQuery.png" />
|
||||||
</view>
|
</view>
|
||||||
|
@ -3,31 +3,20 @@
|
|||||||
<uni-popup ref="popup" type="dialog">
|
<uni-popup ref="popup" type="dialog">
|
||||||
<view class="popup-content">
|
<view class="popup-content">
|
||||||
<view class="info-item">
|
<view class="info-item">
|
||||||
<label>物料编码:</label>
|
<label>是否呼叫以下货架:</label>
|
||||||
<text>{{fixedInfo.matCode}}</text>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="info-item">
|
<view class="info-item" style="font-size: 50rpx;">
|
||||||
<label>物料名称:</label>
|
<text>{{fixedInfo.shelfCode}}</text>
|
||||||
<text>{{fixedInfo.matName}}</text>
|
|
||||||
</view>
|
|
||||||
<view class="info-item">
|
|
||||||
<label>物料规格:</label>
|
|
||||||
<text>{{fixedInfo.matSpec}}</text>
|
|
||||||
</view>
|
|
||||||
<view class="input-item" style="background-color: wheat;">
|
|
||||||
<label>数量:</label>
|
|
||||||
<input ref="inputRef" v-model.number="inputValue" type="number" placeholder="输入数量" />
|
|
||||||
</view>
|
</view>
|
||||||
<view class="button-group">
|
<view class="button-group">
|
||||||
<button @click="hidePopup">取消</button>
|
<button @click="hidePopup">取消</button>
|
||||||
<button @click="saveData">保存</button>
|
<button @click="saveData">确认</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</uni-popup>
|
</uni-popup>
|
||||||
|
|
||||||
<view class="diy-flex-row">
|
<view class="diy-flex-row">
|
||||||
<view style="flex: 3">
|
<view style="flex: 3">
|
||||||
<!-- 占位 -->
|
|
||||||
</view>
|
</view>
|
||||||
<view style="flex: 80;margin: 5rpx;">
|
<view style="flex: 80;margin: 5rpx;">
|
||||||
<view class="diy-flex-row">
|
<view class="diy-flex-row">
|
||||||
@ -124,23 +113,15 @@
|
|||||||
} = getCurrentInstance();
|
} = getCurrentInstance();
|
||||||
// 不能修改的信息
|
// 不能修改的信息
|
||||||
const fixedInfo = {
|
const fixedInfo = {
|
||||||
infoId: 0,
|
shelfId: 0,
|
||||||
matCode: '示例名称',
|
shelfCode: '',
|
||||||
matName: '这是一段示例描述',
|
|
||||||
matSpec: '',
|
|
||||||
matQty: 0,
|
|
||||||
};
|
};
|
||||||
const popup = ref(null);
|
const popup = ref(null);
|
||||||
const inputValue = ref('');
|
const inputValue = ref('');
|
||||||
|
|
||||||
const showPopup = (info) => {
|
const showPopup = (info) => {
|
||||||
fixedInfo.infoId = info.id;
|
fixedInfo.shelfId = info.shelfId;
|
||||||
fixedInfo.matCode = info.matCode;
|
fixedInfo.shelfCode = info.shelfCode;
|
||||||
fixedInfo.matName = info.matName;
|
|
||||||
fixedInfo.matSpec = info.matSpec;
|
|
||||||
fixedInfo.matQty = info.matQty;
|
|
||||||
|
|
||||||
inputValue.value = info.matQty;
|
|
||||||
|
|
||||||
popup.value.open();
|
popup.value.open();
|
||||||
};
|
};
|
||||||
@ -150,41 +131,18 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
const saveData = () => {
|
const saveData = () => {
|
||||||
if (inputValue.value == fixedInfo.matQty) {
|
|
||||||
uni.showToast({
|
|
||||||
title: '本次修改未修改数量',
|
|
||||||
icon: 'none',
|
|
||||||
duration: 1500
|
|
||||||
});
|
|
||||||
hidePopup();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (inputValue.value < 0) {
|
|
||||||
uni.showToast({
|
|
||||||
title: '您所输入的数量应该大于0!',
|
|
||||||
icon: 'none',
|
|
||||||
duration: 1500
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (inputValue.value == 0) {
|
|
||||||
uni.showToast({
|
|
||||||
title: '数量为0,请使用删除功能!',
|
|
||||||
icon: 'none',
|
|
||||||
duration: 1500
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
var serverIPAndPort = getServerIPAndPort();
|
var serverIPAndPort = getServerIPAndPort();
|
||||||
|
|
||||||
//调用接口进行数量的修改
|
//调用接口进行货架的呼叫
|
||||||
uni.request({
|
uni.request({
|
||||||
url: 'http://' + serverIPAndPort +
|
url: 'http://' + serverIPAndPort +
|
||||||
'/matDetailCurrenInfo/updateMatDetailCurrentInfoById', // 请求的接口地址
|
'/pdaProductionLineCallIn/callIn', // 请求的接口地址
|
||||||
method: 'POST', // 设置请求方式为 POST
|
method: 'POST', // 设置请求方式为 POST
|
||||||
data: {
|
data: {
|
||||||
"matQty": inputValue.value,
|
"locationId": proxy.locationId,
|
||||||
"matDetailCurrentInfoId": fixedInfo.infoId,
|
"locationCode": proxy.locationCode,
|
||||||
|
"shelfId": fixedInfo.shelfId,
|
||||||
|
"shelfCode": fixedInfo.shelfCode,
|
||||||
"userName": getConfig('userName', 'admin'),
|
"userName": getConfig('userName', 'admin'),
|
||||||
"deviceType": "PDA"
|
"deviceType": "PDA"
|
||||||
},
|
},
|
||||||
@ -197,16 +155,18 @@
|
|||||||
//接口返回数据为200 表示获取成功!
|
//接口返回数据为200 表示获取成功!
|
||||||
if (res.data.code == 200) {
|
if (res.data.code == 200) {
|
||||||
hidePopup();
|
hidePopup();
|
||||||
|
|
||||||
|
|
||||||
|
proxy.queryMatList();
|
||||||
|
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '修改成功!',
|
title: '呼叫成功!',
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 2000
|
duration: 4000
|
||||||
});
|
});
|
||||||
|
|
||||||
proxy.queryMatList();
|
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '修改失败:' + res.data.message,
|
title: res.data.message,
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 2500
|
duration: 2500
|
||||||
});
|
});
|
||||||
@ -223,7 +183,7 @@
|
|||||||
fail: (err) => {
|
fail: (err) => {
|
||||||
// 请求失败的回调函数
|
// 请求失败的回调函数
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '请求失败' + err,
|
title: '呼叫失败(请求失败)' + err,
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 2500
|
duration: 2500
|
||||||
});
|
});
|
||||||
@ -248,7 +208,7 @@
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
||||||
placeholderText: '请先扫描工位码',
|
placeholderText: '请先扫描工位码',
|
||||||
matCodeCondition: '', //物料编码搜索条件
|
matCodeCondition: '', //物料编码搜索条件
|
||||||
//工位ID 工位码
|
//工位ID 工位码
|
||||||
@ -257,9 +217,9 @@
|
|||||||
|
|
||||||
userName: '', //当前登录的用户名 用于调用接口传参
|
userName: '', //当前登录的用户名 用于调用接口传参
|
||||||
|
|
||||||
recordCount: 0,//记录数
|
recordCount: 0, //记录数
|
||||||
cardData: null,//列表数据
|
cardData: null, //列表数据
|
||||||
|
|
||||||
shelfId: null,
|
shelfId: null,
|
||||||
shelfCode: '',
|
shelfCode: '',
|
||||||
|
|
||||||
@ -289,15 +249,12 @@
|
|||||||
var serverIPAndPort = getServerIPAndPort();
|
var serverIPAndPort = getServerIPAndPort();
|
||||||
uni.request({
|
uni.request({
|
||||||
url: 'http://' + serverIPAndPort +
|
url: 'http://' + serverIPAndPort +
|
||||||
'/matDetailCurrenInfo/getMatDetailCurrentInfos', // 请求的接口地址
|
'/pdaProductionLineCallIn/getLocationInfoForCallIn', // 请求的接口地址
|
||||||
method: 'POST', // 设置请求方式为 POST
|
method: 'POST', // 设置请求方式为 POST
|
||||||
data: {
|
data: {
|
||||||
"shelfCode": this.shelfCode,
|
"locationCode": this.locationCode,
|
||||||
"matCode": '',
|
|
||||||
"userName": this.userName,
|
"userName": this.userName,
|
||||||
"deviceType": "PDA",
|
"deviceType": "PDA",
|
||||||
"pageNumber": 1,
|
|
||||||
"pageSize": 300,
|
|
||||||
},
|
},
|
||||||
header: {
|
header: {
|
||||||
'Content-Type': 'application/json', // 如果需要以JSON格式发送数据
|
'Content-Type': 'application/json', // 如果需要以JSON格式发送数据
|
||||||
@ -310,28 +267,32 @@
|
|||||||
//未查询到信息
|
//未查询到信息
|
||||||
if (res.data.data == null || res.data.data.count == 0) {
|
if (res.data.data == null || res.data.data.count == 0) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '该货架不存在绑定的物料信息!',
|
title: '未获取到该工位相关信息!',
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 1500
|
duration: 1500
|
||||||
});
|
});
|
||||||
|
this.clearLocation();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//有物料信息
|
//有工位的信息
|
||||||
this.cardData = res.data.data.lists;
|
this.locationId = res.data.data.locationId;
|
||||||
this.recordCount = res.data.data.count;
|
this.locationCode = res.data.data.locationCode;
|
||||||
uni.showToast({
|
this.matCodeCondition = '';
|
||||||
title: '获取成功!',
|
this.placeholderText = '可以输入查询';
|
||||||
icon: 'none',
|
|
||||||
duration: 100
|
// uni.showToast({
|
||||||
});
|
// title: '获取成功!',
|
||||||
|
// icon: 'none',
|
||||||
|
// duration: 1000
|
||||||
|
// });
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '获取失败:' + res.data.message,
|
title: res.data.message,
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 3500
|
duration: 3500
|
||||||
});
|
});
|
||||||
this.clear();
|
this.clearLocation();
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@ -340,7 +301,7 @@
|
|||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 3000
|
duration: 3000
|
||||||
});
|
});
|
||||||
this.clear();
|
this.clearLocation();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
fail: (err) => {
|
fail: (err) => {
|
||||||
@ -351,7 +312,7 @@
|
|||||||
duration: 3000
|
duration: 3000
|
||||||
});
|
});
|
||||||
|
|
||||||
this.clear();
|
this.clearLocation();
|
||||||
},
|
},
|
||||||
complete: (event) => {
|
complete: (event) => {
|
||||||
// 请求完成的回调函数(无论成功或失败都会调用)
|
// 请求完成的回调函数(无论成功或失败都会调用)
|
||||||
@ -362,27 +323,31 @@
|
|||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
//搜索获取物料信息
|
||||||
queryMatList: function() {
|
queryMatList: function() {
|
||||||
if (this.shelfCode == null || this.shelfCode == '') {
|
if (this.locationCode == null || this.locationCode == '') {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '请先扫描货架码!',
|
title: '请先扫描工位码!',
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 1000
|
duration: 1000
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.matCodeCondition == this.locationCode) {
|
||||||
|
this.matCodeCondition = '';
|
||||||
|
}
|
||||||
var serverIPAndPort = getServerIPAndPort();
|
var serverIPAndPort = getServerIPAndPort();
|
||||||
uni.request({
|
uni.request({
|
||||||
url: 'http://' + serverIPAndPort +
|
url: 'http://' + serverIPAndPort +
|
||||||
'/matDetailCurrenInfo/getMatDetailCurrentInfos', // 请求的接口地址
|
'/pdaProductionLineCallIn/getMatDetailCurrentInfosForCallIn', // 请求的接口地址
|
||||||
method: 'POST', // 设置请求方式为 POST
|
method: 'POST', // 设置请求方式为 POST
|
||||||
data: {
|
data: {
|
||||||
"shelfCode": this.shelfCode,
|
"locationId": this.locationId,
|
||||||
"matCode": this.matCodeCondition,
|
"locationCode": this.locationCode,
|
||||||
|
"matCodeCondition": this.matCodeCondition,
|
||||||
"userName": this.userName,
|
"userName": this.userName,
|
||||||
"deviceType": "PDA",
|
"deviceType": "PDA"
|
||||||
"pageNumber": 1,
|
|
||||||
"pageSize": 300
|
|
||||||
},
|
},
|
||||||
header: {
|
header: {
|
||||||
'Content-Type': 'application/json', // 如果需要以JSON格式发送数据
|
'Content-Type': 'application/json', // 如果需要以JSON格式发送数据
|
||||||
@ -395,10 +360,11 @@
|
|||||||
//未查询到信息
|
//未查询到信息
|
||||||
if (res.data.data == null || res.data.data.count == 0) {
|
if (res.data.data == null || res.data.data.count == 0) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '该货架不存在绑定的物料信息!',
|
title: '获取失败!',
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 1500
|
duration: 1500
|
||||||
});
|
});
|
||||||
|
this.clear();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//有物料信息
|
//有物料信息
|
||||||
@ -446,10 +412,17 @@
|
|||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
//清空工位码信息
|
||||||
|
clearLocation: function() {
|
||||||
|
this.placeholderText = '请先扫描工位码';
|
||||||
|
this.locationId = 0;
|
||||||
|
this.locationCode = '';
|
||||||
|
|
||||||
|
this.cardData = null;
|
||||||
|
this.recordCount = 0;
|
||||||
|
},
|
||||||
//清空当前界面所有内容
|
//清空当前界面所有内容
|
||||||
clear: function() {
|
clear: function() {
|
||||||
this.placeholderText = '请先扫描货架码';
|
|
||||||
this.cardData = null;
|
this.cardData = null;
|
||||||
this.recordCount = 0;
|
this.recordCount = 0;
|
||||||
},
|
},
|
||||||
|
@ -1,22 +1,544 @@
|
|||||||
<template>
|
<template>
|
||||||
<view>
|
<view class="bg-image">
|
||||||
|
<uni-popup ref="popup" type="dialog">
|
||||||
|
<view class="popup-content">
|
||||||
|
<view class="info-item">
|
||||||
|
<label>物料编码:</label>
|
||||||
|
<text>{{fixedInfo.matCode}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="info-item">
|
||||||
|
<label>物料名称:</label>
|
||||||
|
<text>{{fixedInfo.matName}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="info-item">
|
||||||
|
<label>物料规格:</label>
|
||||||
|
<text>{{fixedInfo.matSpec}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="input-item" style="background-color: wheat;">
|
||||||
|
<label>数量:</label>
|
||||||
|
<input ref="inputRef" v-model.number="inputValue" type="number" placeholder="输入数量" />
|
||||||
|
</view>
|
||||||
|
<view class="button-group">
|
||||||
|
<button @click="hidePopup">取消</button>
|
||||||
|
<button @click="saveData">保存</button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</uni-popup>
|
||||||
|
|
||||||
|
<view class="diy-flex-row">
|
||||||
|
<view style="flex: 3">
|
||||||
|
<!-- 占位 -->
|
||||||
|
</view>
|
||||||
|
<view style="flex: 80;margin: 5rpx;">
|
||||||
|
<view class="diy-flex-row">
|
||||||
|
<view class="rightImageContainer" style="flex: 12;padding-top: 20rpx;">
|
||||||
|
<image style="width: 60rpx;height: 60rpx" src="/static/scan.png" />
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="uni-input-wrapper" style="flex: 60;">
|
||||||
|
<input id="inputMatCode" class="uni-input" style="font-size: 50rpx; padding: 10rpx;"
|
||||||
|
:placeholder="placeholderText" v-model="matCodeCondition" @blur="queryMatList"></input>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view style="flex: 3;">
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view style="flex: 30;">
|
||||||
|
<button @click="analysisScanCode(this.shelfCode)">查询</button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view style="flex: 2">
|
||||||
|
<!-- 占位 -->
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="diy-flex-column" style="margin-top: 5rpx;">
|
||||||
|
<view class="diy-flex-inforow">
|
||||||
|
<view style="width: 740;">货架码:{{shelfCode}}</view>
|
||||||
|
</view>
|
||||||
|
<view class="diy-flex-inforow">
|
||||||
|
<view style="width: 740;">工位码:{{shelfCode}}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="diy-flex-column" style="margin-top: 5rpx;">
|
||||||
|
<scroll-view class="scroll-view" scroll-y="true">
|
||||||
|
<view v-for="(item, index) in cardData" :key="index" @touchstart="cardTouchStart"
|
||||||
|
@touchmove="cardTouchMove" @longpress="longpress(item)">
|
||||||
|
<StocktakingCard :class="cardClass(item)" :item="item" :currentIndex="index" :cardData="cardData" />
|
||||||
|
</view>
|
||||||
|
</scroll-view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="floating-bar"
|
||||||
|
style="position: fixed; bottom: 0; left: 0; width: 100%; background-color: #fff; display: flex; justify-content: space-between; align-items: center; padding: 10rpx;">
|
||||||
|
<select style="width: 200rpx;" v-model="selectedShelfAreaOption">
|
||||||
|
<option v-for="area in shelfAreaOptions" :value="area.value" :key="area.id">{{area.text}}</option>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select style="width: 200rpx;" v-model="selectedShelfTypeOption">
|
||||||
|
<option v-for="type1 in shelfTypeOptions" :value="type1.value" :key="type1.id">{{type1.text}}</option>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<button style="width: 200rpx;background: green;color: white;">货架送回</button>
|
||||||
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import bindSelectMat from '@/pages/bindSelectMat/bindSelectMat.vue';
|
||||||
|
|
||||||
|
import {
|
||||||
|
recive
|
||||||
|
} from '../../src/libs/Broadcast.js';
|
||||||
|
|
||||||
|
import {
|
||||||
|
unregisterReceiver
|
||||||
|
} from '../../src/libs/Broadcast.js';
|
||||||
|
|
||||||
|
import {
|
||||||
|
getConfig
|
||||||
|
} from '@/config.js';
|
||||||
|
|
||||||
|
import {
|
||||||
|
saveConfig
|
||||||
|
} from '@/config.js';
|
||||||
|
|
||||||
|
import {
|
||||||
|
getServerIPAndPort
|
||||||
|
} from '@/config.js';
|
||||||
|
|
||||||
|
import StocktakingCard from '@/components/StocktakingCard.vue';
|
||||||
|
import {
|
||||||
|
ref,
|
||||||
|
onMounted,
|
||||||
|
nextTick
|
||||||
|
} from 'vue';
|
||||||
|
import uniPopup from '@/node_modules/@dcloudio/uni-ui/lib/uni-popup/uni-popup';
|
||||||
|
import {
|
||||||
|
getCurrentInstance
|
||||||
|
} from 'vue';
|
||||||
export default {
|
export default {
|
||||||
|
components: {
|
||||||
|
uniPopup,
|
||||||
|
StocktakingCard
|
||||||
|
},
|
||||||
|
setup() {
|
||||||
|
const {
|
||||||
|
proxy
|
||||||
|
} = getCurrentInstance();
|
||||||
|
// 不能修改的信息
|
||||||
|
const fixedInfo = ref({
|
||||||
|
infoId: 0,
|
||||||
|
matCode: '示例名称',
|
||||||
|
matName: '这是一段示例描述',
|
||||||
|
matSpec: '',
|
||||||
|
matQty: 0,
|
||||||
|
stocktakingQty: 0,
|
||||||
|
});
|
||||||
|
const popup = ref(null);
|
||||||
|
const inputValue = ref('');
|
||||||
|
const showPopup = (info) => {
|
||||||
|
fixedInfo.infoId = info.id;
|
||||||
|
|
||||||
|
fixedInfo.value.matName = info.matName;
|
||||||
|
fixedInfo.value.matCode = info.matCode;
|
||||||
|
fixedInfo.value.matSpec = info.matSpec;
|
||||||
|
fixedInfo.value.matQty = info.matQty;
|
||||||
|
fixedInfo.value.stocktakingQty = info.stocktakingQty;
|
||||||
|
|
||||||
|
inputValue.value = info.stocktakingQty == -1 ? info.matQty : info.stocktakingQty;
|
||||||
|
|
||||||
|
popup.value.open();
|
||||||
|
};
|
||||||
|
|
||||||
|
const hidePopup = () => {
|
||||||
|
popup.value.close();
|
||||||
|
};
|
||||||
|
|
||||||
|
const saveData = () => {
|
||||||
|
if (fixedInfo.value.stocktakingQty != -1 && inputValue.value == fixedInfo.value.stocktakingQty) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '本次修改未修改数量',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 1500
|
||||||
|
});
|
||||||
|
hidePopup();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (inputValue.value < 0) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '您所输入的数量应该大于等于0!',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 1500
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var serverIPAndPort = getServerIPAndPort();
|
||||||
|
|
||||||
|
//调用接口进行数量的修改
|
||||||
|
uni.request({
|
||||||
|
url: 'http://' + serverIPAndPort +
|
||||||
|
'/pdaStocktaking/stockTakingById', // 请求的接口地址
|
||||||
|
method: 'POST', // 设置请求方式为 POST
|
||||||
|
data: {
|
||||||
|
"stocktakingQty": inputValue.value,
|
||||||
|
"matDetailCurrentInfoId": fixedInfo.infoId,
|
||||||
|
"userName": getConfig('userName', 'admin'),
|
||||||
|
"deviceType": "PDA"
|
||||||
|
},
|
||||||
|
header: {
|
||||||
|
'Content-Type': 'application/json', // 如果需要以JSON格式发送数据
|
||||||
|
},
|
||||||
|
success: (res) => {
|
||||||
|
// 请求成功的回调函数
|
||||||
|
if (res.statusCode === 200) {
|
||||||
|
//接口返回数据为200 表示获取成功!
|
||||||
|
if (res.data.code == 200) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '成功!',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 1200
|
||||||
|
});
|
||||||
|
hidePopup();
|
||||||
|
|
||||||
|
proxy.refreshData();
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: '失败:' + res.data.message,
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2500
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: '服务器返回错误状态码' + res.statusCode,
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2500
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
// 请求失败的回调函数
|
||||||
|
uni.showToast({
|
||||||
|
title: '请求失败' + err,
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2500
|
||||||
|
});
|
||||||
|
|
||||||
|
this.clear();
|
||||||
|
},
|
||||||
|
complete: (event) => {
|
||||||
|
// 请求完成的回调函数(无论成功或失败都会调用)
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
return {
|
||||||
|
fixedInfo,
|
||||||
|
popup,
|
||||||
|
inputValue,
|
||||||
|
showPopup,
|
||||||
|
hidePopup,
|
||||||
|
saveData
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
locationId: null,
|
||||||
|
locationCode: '',
|
||||||
|
|
||||||
|
userName: '', //当前登录的用户名
|
||||||
|
|
||||||
|
recordCount: 0,
|
||||||
|
shelfId: null,
|
||||||
|
shelfCode: '',
|
||||||
|
placeholderText: '请先扫描货架码',
|
||||||
|
matCodeCondition: '', //物料编码搜索条件
|
||||||
|
cardData: null,
|
||||||
|
|
||||||
|
//监控滑动的位置
|
||||||
|
touchStartX: 0,
|
||||||
|
touchStartY: 0,
|
||||||
|
isMove: false, //滑动标识 是否滑动
|
||||||
|
|
||||||
|
|
||||||
|
selectedShelfAreaOption: '', // 初始选中值,可以是空字符串或预定义的值
|
||||||
|
shelfAreaOptions: [ // 选项列表
|
||||||
|
{
|
||||||
|
id: 1,
|
||||||
|
value: 'type1',
|
||||||
|
text: '类型1'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 2,
|
||||||
|
value: 'type2',
|
||||||
|
text: '类型2'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 3,
|
||||||
|
value: 'type3',
|
||||||
|
text: '类型3'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
|
||||||
|
shelfTypeOptions: [ // 选项列表
|
||||||
|
{
|
||||||
|
id: 1,
|
||||||
|
value: '1',
|
||||||
|
text: '空货架'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 2,
|
||||||
|
value: '2',
|
||||||
|
text: '非空货架'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
selectedShelfTypeOption: '', // 初始选中值,可以是空字符串或预定义的值
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
onShow: function() {
|
||||||
|
this.userName = getConfig('userName', 'admin');
|
||||||
|
|
||||||
|
const self = this; // 保存this的引用
|
||||||
|
recive(function(res) {
|
||||||
|
console.log("Success:" + res.data);
|
||||||
|
self.analysisScanCode(res.data);
|
||||||
|
}, function(err) {
|
||||||
|
console.log("Error:", JSON.stringify(err)); // 正确打印错误信息
|
||||||
|
});
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
refreshData: function() {
|
||||||
|
this.analysisScanCode(this.shelfCode);
|
||||||
|
},
|
||||||
|
analysisScanCode: function(encodedString) {
|
||||||
|
// 去除末尾的逗号和"..."(如果有的话)
|
||||||
|
encodedString = encodedString.replace(/,\s*\.\.\.$/, '');
|
||||||
|
this.shelfCode = encodedString;
|
||||||
|
//调用接口获取当前工位信息 当前工位是否有货架
|
||||||
|
var serverIPAndPort = getServerIPAndPort();
|
||||||
|
uni.request({
|
||||||
|
url: 'http://' + serverIPAndPort +
|
||||||
|
'/pdaStocktaking/getStocktakingInfosByShelfCode', // 请求的接口地址
|
||||||
|
method: 'POST', // 设置请求方式为 POST
|
||||||
|
data: {
|
||||||
|
"shelfCode": this.shelfCode,
|
||||||
|
"userName": this.userName,
|
||||||
|
"deviceType": "PDA",
|
||||||
|
"pageNumber": 1,
|
||||||
|
"pageSize": 1000
|
||||||
|
},
|
||||||
|
header: {
|
||||||
|
'Content-Type': 'application/json', // 如果需要以JSON格式发送数据
|
||||||
|
},
|
||||||
|
success: (res) => {
|
||||||
|
// 请求成功的回调函数
|
||||||
|
if (res.statusCode === 200) {
|
||||||
|
//接口返回数据为200 表示获取成功!
|
||||||
|
if (res.data.code == 200) {
|
||||||
|
//未查询到信息
|
||||||
|
if (res.data.data == null || res.data.data.count == 0) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '该货架不存在绑定的物料信息!',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 1500
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//有物料信息
|
||||||
|
this.cardData = res.data.data.lists;
|
||||||
|
this.recordCount = res.data.data.count;
|
||||||
|
uni.showToast({
|
||||||
|
title: '获取成功!',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 100
|
||||||
|
});
|
||||||
|
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: '获取失败:' + res.data.message,
|
||||||
|
icon: 'none',
|
||||||
|
duration: 3500
|
||||||
|
});
|
||||||
|
this.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: '服务器返回错误状态码' + res.statusCode,
|
||||||
|
icon: 'none',
|
||||||
|
duration: 3000
|
||||||
|
});
|
||||||
|
this.clear();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
// 请求失败的回调函数
|
||||||
|
uni.showToast({
|
||||||
|
title: '请求失败' + err,
|
||||||
|
icon: 'none',
|
||||||
|
duration: 3000
|
||||||
|
});
|
||||||
|
|
||||||
|
this.clear();
|
||||||
|
},
|
||||||
|
complete: (event) => {
|
||||||
|
// 请求完成的回调函数(无论成功或失败都会调用)
|
||||||
|
console.log('请求完成', event);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
//清空当前界面所有内容
|
||||||
|
clear: function() {
|
||||||
|
this.placeholderText = '请先扫描货架码';
|
||||||
|
this.cardData = null;
|
||||||
|
this.recordCount = 0;
|
||||||
|
},
|
||||||
|
|
||||||
|
//解决长按和滑动冲突的问题
|
||||||
|
cardTouchStart(e) {
|
||||||
|
this.isMove = false;
|
||||||
|
this.touchStartX = e.touches[0].clientX;
|
||||||
|
this.touchStartY = e.touches[0].clientY;
|
||||||
|
},
|
||||||
|
cardTouchMove(e) {
|
||||||
|
var deltaX = e.changedTouches[0].clientX - this.touchStartX;
|
||||||
|
var deltaY = e.changedTouches[0].clientY - this.touchStartY;
|
||||||
|
if (Math.abs(deltaX) > 5 || Math.abs(deltaY) > 5) {
|
||||||
|
this.isMove = true;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//长按
|
||||||
|
longpress(item) {
|
||||||
|
if (this.isMove == false) {
|
||||||
|
this.showPopup(item);
|
||||||
|
}
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
.uni-input-wrapper {
|
||||||
|
/* #ifndef APP-NVUE */
|
||||||
|
display: flex;
|
||||||
|
/* #endif */
|
||||||
|
flex-direction: row;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
.mini-btn {
|
||||||
|
margin-right: 10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg-image {
|
||||||
|
background-image: url('/static/background.png');
|
||||||
|
/* 背景图片路径 */
|
||||||
|
background-size: cover;
|
||||||
|
/* 背景图片覆盖整个元素 */
|
||||||
|
background-position: center;
|
||||||
|
/* 背景图片居中 */
|
||||||
|
height: 100%;
|
||||||
|
/* 视图高度设置为100% */
|
||||||
|
width: 100%;
|
||||||
|
/* 视图宽度设置为100% */
|
||||||
|
position: fixed;
|
||||||
|
/* 视图定位为固定 */
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
/* z-index: -1; */
|
||||||
|
}
|
||||||
|
|
||||||
|
.diy-flex-row {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
margin-top: 10rpx;
|
||||||
|
margin-bottom: 10rpx;
|
||||||
|
font-size: 40rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.diy-flex-column {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.diy-flex-inforow {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
font-size: 40rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
margin-top: 8rpx;
|
||||||
|
margin-bottom: 8rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.scroll-view {
|
||||||
|
height: 75vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-content {
|
||||||
|
padding: 20px;
|
||||||
|
background-color: rgba(0, 0, 0, 1);
|
||||||
|
background-color: white;
|
||||||
|
z-index: 2;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.input-item {
|
||||||
|
margin-bottom: 5rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
/* 让内部元素垂直居中 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.input-item label {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input-item input {
|
||||||
|
display: inline-block;
|
||||||
|
background: wheat;
|
||||||
|
width: 280rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button-group {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button-group button {
|
||||||
|
margin-top: 20rpx;
|
||||||
|
padding: 10rpx 10rpx;
|
||||||
|
border: none;
|
||||||
|
border-radius: 5px;
|
||||||
|
background-color: #007AFF;
|
||||||
|
color: #fff;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.cardNoStocktaking {
|
||||||
|
border: 3rpx solid black;
|
||||||
|
border-radius: 15rpx;
|
||||||
|
margin: 8rpx;
|
||||||
|
padding: 8rpx;
|
||||||
|
background-color: beige;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cardYesStocktaking {
|
||||||
|
border: 3rpx solid black;
|
||||||
|
border-radius: 15rpx;
|
||||||
|
margin: 8rpx;
|
||||||
|
padding: 8rpx;
|
||||||
|
background-color: seagreen;
|
||||||
|
}
|
||||||
|
</style>
|
@ -235,10 +235,6 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
641
PDA/PDA/unpackage/dist/dev/app-plus/app-service.js
vendored
641
PDA/PDA/unpackage/dist/dev/app-plus/app-service.js
vendored
@ -431,7 +431,7 @@ if (uni.restoreGlobal) {
|
|||||||
style: { "flex": "5" }
|
style: { "flex": "5" }
|
||||||
}, [
|
}, [
|
||||||
vue.createElementVNode("navigator", {
|
vue.createElementVNode("navigator", {
|
||||||
url: "../bind/bind",
|
url: "../queryBindList/queryBindList",
|
||||||
"hover-class": "navigator-hover"
|
"hover-class": "navigator-hover"
|
||||||
}, [
|
}, [
|
||||||
vue.createElementVNode("view", {
|
vue.createElementVNode("view", {
|
||||||
@ -2532,10 +2532,10 @@ if (uni.restoreGlobal) {
|
|||||||
this.userName = getConfig("userName", "admin");
|
this.userName = getConfig("userName", "admin");
|
||||||
const self = this;
|
const self = this;
|
||||||
recive(function(res) {
|
recive(function(res) {
|
||||||
formatAppLog("log", "at pages/queryBindList/queryBindList.vue:278", "Success:" + res.data);
|
formatAppLog("log", "at pages/queryBindList/queryBindList.vue:274", "Success:" + res.data);
|
||||||
self.analysisScanCode(res.data);
|
self.analysisScanCode(res.data);
|
||||||
}, function(err) {
|
}, function(err) {
|
||||||
formatAppLog("log", "at pages/queryBindList/queryBindList.vue:281", "Error:", JSON.stringify(err));
|
formatAppLog("log", "at pages/queryBindList/queryBindList.vue:277", "Error:", JSON.stringify(err));
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@ -2604,7 +2604,7 @@ if (uni.restoreGlobal) {
|
|||||||
this.clear();
|
this.clear();
|
||||||
},
|
},
|
||||||
complete: (event) => {
|
complete: (event) => {
|
||||||
formatAppLog("log", "at pages/queryBindList/queryBindList.vue:373", "请求完成", event);
|
formatAppLog("log", "at pages/queryBindList/queryBindList.vue:369", "请求完成", event);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -2679,7 +2679,7 @@ if (uni.restoreGlobal) {
|
|||||||
this.clear();
|
this.clear();
|
||||||
},
|
},
|
||||||
complete: (event) => {
|
complete: (event) => {
|
||||||
formatAppLog("log", "at pages/queryBindList/queryBindList.vue:458", "请求完成", event);
|
formatAppLog("log", "at pages/queryBindList/queryBindList.vue:454", "请求完成", event);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -3877,61 +3877,31 @@ if (uni.restoreGlobal) {
|
|||||||
proxy
|
proxy
|
||||||
} = vue.getCurrentInstance();
|
} = vue.getCurrentInstance();
|
||||||
const fixedInfo = {
|
const fixedInfo = {
|
||||||
infoId: 0,
|
shelfId: 0,
|
||||||
matCode: "示例名称",
|
shelfCode: ""
|
||||||
matName: "这是一段示例描述",
|
|
||||||
matSpec: "",
|
|
||||||
matQty: 0
|
|
||||||
};
|
};
|
||||||
const popup = vue.ref(null);
|
const popup = vue.ref(null);
|
||||||
const inputValue = vue.ref("");
|
const inputValue = vue.ref("");
|
||||||
const showPopup = (info) => {
|
const showPopup = (info) => {
|
||||||
fixedInfo.infoId = info.id;
|
fixedInfo.shelfId = info.shelfId;
|
||||||
fixedInfo.matCode = info.matCode;
|
fixedInfo.shelfCode = info.shelfCode;
|
||||||
fixedInfo.matName = info.matName;
|
|
||||||
fixedInfo.matSpec = info.matSpec;
|
|
||||||
fixedInfo.matQty = info.matQty;
|
|
||||||
inputValue.value = info.matQty;
|
|
||||||
popup.value.open();
|
popup.value.open();
|
||||||
};
|
};
|
||||||
const hidePopup = () => {
|
const hidePopup = () => {
|
||||||
popup.value.close();
|
popup.value.close();
|
||||||
};
|
};
|
||||||
const saveData = () => {
|
const saveData = () => {
|
||||||
if (inputValue.value == fixedInfo.matQty) {
|
|
||||||
uni.showToast({
|
|
||||||
title: "本次修改未修改数量",
|
|
||||||
icon: "none",
|
|
||||||
duration: 1500
|
|
||||||
});
|
|
||||||
hidePopup();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (inputValue.value < 0) {
|
|
||||||
uni.showToast({
|
|
||||||
title: "您所输入的数量应该大于0!",
|
|
||||||
icon: "none",
|
|
||||||
duration: 1500
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (inputValue.value == 0) {
|
|
||||||
uni.showToast({
|
|
||||||
title: "数量为0,请使用删除功能!",
|
|
||||||
icon: "none",
|
|
||||||
duration: 1500
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
var serverIPAndPort = getServerIPAndPort();
|
var serverIPAndPort = getServerIPAndPort();
|
||||||
uni.request({
|
uni.request({
|
||||||
url: "http://" + serverIPAndPort + "/matDetailCurrenInfo/updateMatDetailCurrentInfoById",
|
url: "http://" + serverIPAndPort + "/pdaProductionLineCallIn/callIn",
|
||||||
// 请求的接口地址
|
// 请求的接口地址
|
||||||
method: "POST",
|
method: "POST",
|
||||||
// 设置请求方式为 POST
|
// 设置请求方式为 POST
|
||||||
data: {
|
data: {
|
||||||
"matQty": inputValue.value,
|
"locationId": proxy.locationId,
|
||||||
"matDetailCurrentInfoId": fixedInfo.infoId,
|
"locationCode": proxy.locationCode,
|
||||||
|
"shelfId": fixedInfo.shelfId,
|
||||||
|
"shelfCode": fixedInfo.shelfCode,
|
||||||
"userName": getConfig("userName", "admin"),
|
"userName": getConfig("userName", "admin"),
|
||||||
"deviceType": "PDA"
|
"deviceType": "PDA"
|
||||||
},
|
},
|
||||||
@ -3943,15 +3913,15 @@ if (uni.restoreGlobal) {
|
|||||||
if (res.statusCode === 200) {
|
if (res.statusCode === 200) {
|
||||||
if (res.data.code == 200) {
|
if (res.data.code == 200) {
|
||||||
hidePopup();
|
hidePopup();
|
||||||
uni.showToast({
|
|
||||||
title: "修改成功!",
|
|
||||||
icon: "none",
|
|
||||||
duration: 2e3
|
|
||||||
});
|
|
||||||
proxy.queryMatList();
|
proxy.queryMatList();
|
||||||
|
uni.showToast({
|
||||||
|
title: "呼叫成功!",
|
||||||
|
icon: "none",
|
||||||
|
duration: 4e3
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "修改失败:" + res.data.message,
|
title: res.data.message,
|
||||||
icon: "none",
|
icon: "none",
|
||||||
duration: 2500
|
duration: 2500
|
||||||
});
|
});
|
||||||
@ -3966,7 +3936,7 @@ if (uni.restoreGlobal) {
|
|||||||
},
|
},
|
||||||
fail: (err) => {
|
fail: (err) => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "请求失败" + err,
|
title: "呼叫失败(请求失败)" + err,
|
||||||
icon: "none",
|
icon: "none",
|
||||||
duration: 2500
|
duration: 2500
|
||||||
});
|
});
|
||||||
@ -4012,10 +3982,10 @@ if (uni.restoreGlobal) {
|
|||||||
this.userName = getConfig("userName", "admin");
|
this.userName = getConfig("userName", "admin");
|
||||||
const self = this;
|
const self = this;
|
||||||
recive(function(res) {
|
recive(function(res) {
|
||||||
formatAppLog("log", "at pages/productionLineCallIn/productionLineCallIn.vue:276", "Success:" + res.data);
|
formatAppLog("log", "at pages/productionLineCallIn/productionLineCallIn.vue:236", "Success:" + res.data);
|
||||||
self.analysisScanCode(res.data);
|
self.analysisScanCode(res.data);
|
||||||
}, function(err) {
|
}, function(err) {
|
||||||
formatAppLog("log", "at pages/productionLineCallIn/productionLineCallIn.vue:280", "Error:", JSON.stringify(err));
|
formatAppLog("log", "at pages/productionLineCallIn/productionLineCallIn.vue:240", "Error:", JSON.stringify(err));
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@ -4024,17 +3994,14 @@ if (uni.restoreGlobal) {
|
|||||||
this.locationCode = encodedString;
|
this.locationCode = encodedString;
|
||||||
var serverIPAndPort = getServerIPAndPort();
|
var serverIPAndPort = getServerIPAndPort();
|
||||||
uni.request({
|
uni.request({
|
||||||
url: "http://" + serverIPAndPort + "/matDetailCurrenInfo/getMatDetailCurrentInfos",
|
url: "http://" + serverIPAndPort + "/pdaProductionLineCallIn/getLocationInfoForCallIn",
|
||||||
// 请求的接口地址
|
// 请求的接口地址
|
||||||
method: "POST",
|
method: "POST",
|
||||||
// 设置请求方式为 POST
|
// 设置请求方式为 POST
|
||||||
data: {
|
data: {
|
||||||
"shelfCode": this.shelfCode,
|
"locationCode": this.locationCode,
|
||||||
"matCode": "",
|
|
||||||
"userName": this.userName,
|
"userName": this.userName,
|
||||||
"deviceType": "PDA",
|
"deviceType": "PDA"
|
||||||
"pageNumber": 1,
|
|
||||||
"pageSize": 300
|
|
||||||
},
|
},
|
||||||
header: {
|
header: {
|
||||||
"Content-Type": "application/json"
|
"Content-Type": "application/json"
|
||||||
@ -4045,26 +4012,24 @@ if (uni.restoreGlobal) {
|
|||||||
if (res.data.code == 200) {
|
if (res.data.code == 200) {
|
||||||
if (res.data.data == null || res.data.data.count == 0) {
|
if (res.data.data == null || res.data.data.count == 0) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "该货架不存在绑定的物料信息!",
|
title: "未获取到该工位相关信息!",
|
||||||
icon: "none",
|
icon: "none",
|
||||||
duration: 1500
|
duration: 1500
|
||||||
});
|
});
|
||||||
|
this.clearLocation();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.cardData = res.data.data.lists;
|
this.locationId = res.data.data.locationId;
|
||||||
this.recordCount = res.data.data.count;
|
this.locationCode = res.data.data.locationCode;
|
||||||
uni.showToast({
|
this.matCodeCondition = "";
|
||||||
title: "获取成功!",
|
this.placeholderText = "可以输入查询";
|
||||||
icon: "none",
|
|
||||||
duration: 100
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "获取失败:" + res.data.message,
|
title: res.data.message,
|
||||||
icon: "none",
|
icon: "none",
|
||||||
duration: 3500
|
duration: 3500
|
||||||
});
|
});
|
||||||
this.clear();
|
this.clearLocation();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
@ -4072,7 +4037,7 @@ if (uni.restoreGlobal) {
|
|||||||
icon: "none",
|
icon: "none",
|
||||||
duration: 3e3
|
duration: 3e3
|
||||||
});
|
});
|
||||||
this.clear();
|
this.clearLocation();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
fail: (err) => {
|
fail: (err) => {
|
||||||
@ -4081,35 +4046,462 @@ if (uni.restoreGlobal) {
|
|||||||
icon: "none",
|
icon: "none",
|
||||||
duration: 3e3
|
duration: 3e3
|
||||||
});
|
});
|
||||||
this.clear();
|
this.clearLocation();
|
||||||
},
|
},
|
||||||
complete: (event) => {
|
complete: (event) => {
|
||||||
formatAppLog("log", "at pages/productionLineCallIn/productionLineCallIn.vue:358", "请求完成", event);
|
formatAppLog("log", "at pages/productionLineCallIn/productionLineCallIn.vue:319", "请求完成", event);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
//搜索获取物料信息
|
||||||
queryMatList: function() {
|
queryMatList: function() {
|
||||||
if (this.shelfCode == null || this.shelfCode == "") {
|
if (this.locationCode == null || this.locationCode == "") {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "请先扫描货架码!",
|
title: "请先扫描工位码!",
|
||||||
icon: "none",
|
icon: "none",
|
||||||
duration: 1e3
|
duration: 1e3
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (this.matCodeCondition == this.locationCode) {
|
||||||
|
this.matCodeCondition = "";
|
||||||
|
}
|
||||||
var serverIPAndPort = getServerIPAndPort();
|
var serverIPAndPort = getServerIPAndPort();
|
||||||
uni.request({
|
uni.request({
|
||||||
url: "http://" + serverIPAndPort + "/matDetailCurrenInfo/getMatDetailCurrentInfos",
|
url: "http://" + serverIPAndPort + "/pdaProductionLineCallIn/getMatDetailCurrentInfosForCallIn",
|
||||||
|
// 请求的接口地址
|
||||||
|
method: "POST",
|
||||||
|
// 设置请求方式为 POST
|
||||||
|
data: {
|
||||||
|
"locationId": this.locationId,
|
||||||
|
"locationCode": this.locationCode,
|
||||||
|
"matCodeCondition": this.matCodeCondition,
|
||||||
|
"userName": this.userName,
|
||||||
|
"deviceType": "PDA"
|
||||||
|
},
|
||||||
|
header: {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
// 如果需要以JSON格式发送数据
|
||||||
|
},
|
||||||
|
success: (res) => {
|
||||||
|
if (res.statusCode === 200) {
|
||||||
|
if (res.data.code == 200) {
|
||||||
|
if (res.data.data == null || res.data.data.count == 0) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "获取失败!",
|
||||||
|
icon: "none",
|
||||||
|
duration: 1500
|
||||||
|
});
|
||||||
|
this.clear();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.cardData = res.data.data.lists;
|
||||||
|
this.recordCount = res.data.data.count;
|
||||||
|
uni.showToast({
|
||||||
|
title: "获取成功!",
|
||||||
|
icon: "none",
|
||||||
|
duration: 100
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: "获取失败:" + res.data.message,
|
||||||
|
icon: "none",
|
||||||
|
duration: 3500
|
||||||
|
});
|
||||||
|
this.clear();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: "服务器返回错误状态码" + res.statusCode,
|
||||||
|
icon: "none",
|
||||||
|
duration: 3e3
|
||||||
|
});
|
||||||
|
this.clear();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
uni.showToast({
|
||||||
|
title: "请求失败" + err,
|
||||||
|
icon: "none",
|
||||||
|
duration: 3e3
|
||||||
|
});
|
||||||
|
this.clear();
|
||||||
|
},
|
||||||
|
complete: (event) => {
|
||||||
|
formatAppLog("log", "at pages/productionLineCallIn/productionLineCallIn.vue:409", "请求完成", event);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//清空工位码信息
|
||||||
|
clearLocation: function() {
|
||||||
|
this.placeholderText = "请先扫描工位码";
|
||||||
|
this.locationId = 0;
|
||||||
|
this.locationCode = "";
|
||||||
|
this.cardData = null;
|
||||||
|
this.recordCount = 0;
|
||||||
|
},
|
||||||
|
//清空当前界面所有内容
|
||||||
|
clear: function() {
|
||||||
|
this.cardData = null;
|
||||||
|
this.recordCount = 0;
|
||||||
|
},
|
||||||
|
//解决长按和滑动冲突的问题
|
||||||
|
cardTouchStart(e) {
|
||||||
|
this.isMove = false;
|
||||||
|
this.touchStartX = e.touches[0].clientX;
|
||||||
|
this.touchStartY = e.touches[0].clientY;
|
||||||
|
},
|
||||||
|
cardTouchMove(e) {
|
||||||
|
var deltaX = e.changedTouches[0].clientX - this.touchStartX;
|
||||||
|
var deltaY = e.changedTouches[0].clientY - this.touchStartY;
|
||||||
|
if (Math.abs(deltaX) > 5 || Math.abs(deltaY) > 5) {
|
||||||
|
this.isMove = true;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//长按
|
||||||
|
longpress(item) {
|
||||||
|
if (this.isMove == false) {
|
||||||
|
this.showPopup(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
||||||
|
const _component_uni_popup = resolveEasycom(vue.resolveDynamicComponent("uni-popup"), __easycom_0);
|
||||||
|
const _component_Card = vue.resolveComponent("Card");
|
||||||
|
return vue.openBlock(), vue.createElementBlock("view", { class: "bg-image" }, [
|
||||||
|
vue.createVNode(
|
||||||
|
_component_uni_popup,
|
||||||
|
{
|
||||||
|
ref: "popup",
|
||||||
|
type: "dialog"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
default: vue.withCtx(() => [
|
||||||
|
vue.createElementVNode("view", { class: "popup-content" }, [
|
||||||
|
vue.createElementVNode("view", { class: "info-item" }, [
|
||||||
|
vue.createElementVNode("label", null, "是否呼叫以下货架:")
|
||||||
|
]),
|
||||||
|
vue.createElementVNode("view", {
|
||||||
|
class: "info-item",
|
||||||
|
style: { "font-size": "50rpx" }
|
||||||
|
}, [
|
||||||
|
vue.createElementVNode(
|
||||||
|
"text",
|
||||||
|
null,
|
||||||
|
vue.toDisplayString($setup.fixedInfo.shelfCode),
|
||||||
|
1
|
||||||
|
/* TEXT */
|
||||||
|
)
|
||||||
|
]),
|
||||||
|
vue.createElementVNode("view", { class: "button-group" }, [
|
||||||
|
vue.createElementVNode("button", {
|
||||||
|
onClick: _cache[0] || (_cache[0] = (...args) => $setup.hidePopup && $setup.hidePopup(...args))
|
||||||
|
}, "取消"),
|
||||||
|
vue.createElementVNode("button", {
|
||||||
|
onClick: _cache[1] || (_cache[1] = (...args) => $setup.saveData && $setup.saveData(...args))
|
||||||
|
}, "确认")
|
||||||
|
])
|
||||||
|
])
|
||||||
|
]),
|
||||||
|
_: 1
|
||||||
|
/* STABLE */
|
||||||
|
},
|
||||||
|
512
|
||||||
|
/* NEED_PATCH */
|
||||||
|
),
|
||||||
|
vue.createElementVNode("view", { class: "diy-flex-row" }, [
|
||||||
|
vue.createElementVNode("view", { style: { "flex": "3" } }),
|
||||||
|
vue.createElementVNode("view", { style: { "flex": "80", "margin": "5rpx" } }, [
|
||||||
|
vue.createElementVNode("view", { class: "diy-flex-row" }, [
|
||||||
|
vue.createElementVNode("view", {
|
||||||
|
class: "rightImageContainer",
|
||||||
|
style: { "flex": "12", "padding-top": "20rpx" }
|
||||||
|
}, [
|
||||||
|
vue.createElementVNode("image", {
|
||||||
|
style: { "width": "60rpx", "height": "60rpx" },
|
||||||
|
src: _imports_0
|
||||||
|
})
|
||||||
|
]),
|
||||||
|
vue.createElementVNode("view", {
|
||||||
|
class: "uni-input-wrapper",
|
||||||
|
style: { "flex": "60" }
|
||||||
|
}, [
|
||||||
|
vue.withDirectives(vue.createElementVNode("input", {
|
||||||
|
id: "inputMatCode",
|
||||||
|
class: "uni-input",
|
||||||
|
style: { "font-size": "50rpx", "padding": "10rpx" },
|
||||||
|
placeholder: $data.placeholderText,
|
||||||
|
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $data.matCodeCondition = $event),
|
||||||
|
onBlur: _cache[3] || (_cache[3] = (...args) => $options.queryMatList && $options.queryMatList(...args))
|
||||||
|
}, null, 40, ["placeholder"]), [
|
||||||
|
[vue.vModelText, $data.matCodeCondition]
|
||||||
|
])
|
||||||
|
]),
|
||||||
|
vue.createElementVNode("view", { style: { "flex": "3" } }),
|
||||||
|
vue.createElementVNode("view", { style: { "flex": "30" } }, [
|
||||||
|
vue.createElementVNode("button", {
|
||||||
|
onClick: _cache[4] || (_cache[4] = (...args) => $options.queryMatList && $options.queryMatList(...args))
|
||||||
|
}, "查询")
|
||||||
|
])
|
||||||
|
])
|
||||||
|
]),
|
||||||
|
vue.createElementVNode("view", { style: { "flex": "2" } }, [
|
||||||
|
vue.createCommentVNode(" 占位 ")
|
||||||
|
])
|
||||||
|
]),
|
||||||
|
vue.createElementVNode("view", {
|
||||||
|
class: "diy-flex-column",
|
||||||
|
style: { "margin-top": "5rpx" }
|
||||||
|
}, [
|
||||||
|
vue.createElementVNode("view", { class: "diy-flex-inforow" }, [
|
||||||
|
vue.createElementVNode("view", { style: { "width": "10rpx" } }),
|
||||||
|
vue.createElementVNode(
|
||||||
|
"view",
|
||||||
|
{ style: { "width": "275rpx" } },
|
||||||
|
"记录数:[" + vue.toDisplayString($data.recordCount) + "]",
|
||||||
|
1
|
||||||
|
/* TEXT */
|
||||||
|
),
|
||||||
|
vue.createElementVNode("view", { style: { "width": "10rpx" } }),
|
||||||
|
vue.createElementVNode(
|
||||||
|
"view",
|
||||||
|
{ style: { "width": "455rpx" } },
|
||||||
|
"工位码:" + vue.toDisplayString($data.locationCode),
|
||||||
|
1
|
||||||
|
/* TEXT */
|
||||||
|
)
|
||||||
|
])
|
||||||
|
]),
|
||||||
|
vue.createElementVNode("view", {
|
||||||
|
class: "diy-flex-column",
|
||||||
|
style: { "margin-top": "5rpx" }
|
||||||
|
}, [
|
||||||
|
vue.createElementVNode("scroll-view", {
|
||||||
|
class: "scroll-view",
|
||||||
|
"scroll-y": "true"
|
||||||
|
}, [
|
||||||
|
(vue.openBlock(true), vue.createElementBlock(
|
||||||
|
vue.Fragment,
|
||||||
|
null,
|
||||||
|
vue.renderList($data.cardData, (item, index) => {
|
||||||
|
return vue.openBlock(), vue.createElementBlock("view", {
|
||||||
|
key: index,
|
||||||
|
onTouchstart: _cache[5] || (_cache[5] = (...args) => $options.cardTouchStart && $options.cardTouchStart(...args)),
|
||||||
|
onTouchmove: _cache[6] || (_cache[6] = (...args) => $options.cardTouchMove && $options.cardTouchMove(...args)),
|
||||||
|
onLongpress: ($event) => $options.longpress(item)
|
||||||
|
}, [
|
||||||
|
vue.createVNode(_component_Card, {
|
||||||
|
item,
|
||||||
|
currentIndex: index,
|
||||||
|
cardData: $data.cardData
|
||||||
|
}, null, 8, ["item", "currentIndex", "cardData"])
|
||||||
|
], 40, ["onLongpress"]);
|
||||||
|
}),
|
||||||
|
128
|
||||||
|
/* KEYED_FRAGMENT */
|
||||||
|
))
|
||||||
|
])
|
||||||
|
])
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
const PagesProductionLineCallInProductionLineCallIn = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$1], ["__file", "E:/代码/赛特制冷WCS/wcs/PDA/PDA/pages/productionLineCallIn/productionLineCallIn.vue"]]);
|
||||||
|
const _sfc_main$1 = {
|
||||||
|
components: {
|
||||||
|
uniPopup,
|
||||||
|
StocktakingCard
|
||||||
|
},
|
||||||
|
setup() {
|
||||||
|
const {
|
||||||
|
proxy
|
||||||
|
} = vue.getCurrentInstance();
|
||||||
|
const fixedInfo = vue.ref({
|
||||||
|
infoId: 0,
|
||||||
|
matCode: "示例名称",
|
||||||
|
matName: "这是一段示例描述",
|
||||||
|
matSpec: "",
|
||||||
|
matQty: 0,
|
||||||
|
stocktakingQty: 0
|
||||||
|
});
|
||||||
|
const popup = vue.ref(null);
|
||||||
|
const inputValue = vue.ref("");
|
||||||
|
const showPopup = (info) => {
|
||||||
|
fixedInfo.infoId = info.id;
|
||||||
|
fixedInfo.value.matName = info.matName;
|
||||||
|
fixedInfo.value.matCode = info.matCode;
|
||||||
|
fixedInfo.value.matSpec = info.matSpec;
|
||||||
|
fixedInfo.value.matQty = info.matQty;
|
||||||
|
fixedInfo.value.stocktakingQty = info.stocktakingQty;
|
||||||
|
inputValue.value = info.stocktakingQty == -1 ? info.matQty : info.stocktakingQty;
|
||||||
|
popup.value.open();
|
||||||
|
};
|
||||||
|
const hidePopup = () => {
|
||||||
|
popup.value.close();
|
||||||
|
};
|
||||||
|
const saveData = () => {
|
||||||
|
if (fixedInfo.value.stocktakingQty != -1 && inputValue.value == fixedInfo.value.stocktakingQty) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "本次修改未修改数量",
|
||||||
|
icon: "none",
|
||||||
|
duration: 1500
|
||||||
|
});
|
||||||
|
hidePopup();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (inputValue.value < 0) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "您所输入的数量应该大于等于0!",
|
||||||
|
icon: "none",
|
||||||
|
duration: 1500
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var serverIPAndPort = getServerIPAndPort();
|
||||||
|
uni.request({
|
||||||
|
url: "http://" + serverIPAndPort + "/pdaStocktaking/stockTakingById",
|
||||||
|
// 请求的接口地址
|
||||||
|
method: "POST",
|
||||||
|
// 设置请求方式为 POST
|
||||||
|
data: {
|
||||||
|
"stocktakingQty": inputValue.value,
|
||||||
|
"matDetailCurrentInfoId": fixedInfo.infoId,
|
||||||
|
"userName": getConfig("userName", "admin"),
|
||||||
|
"deviceType": "PDA"
|
||||||
|
},
|
||||||
|
header: {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
// 如果需要以JSON格式发送数据
|
||||||
|
},
|
||||||
|
success: (res) => {
|
||||||
|
if (res.statusCode === 200) {
|
||||||
|
if (res.data.code == 200) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "成功!",
|
||||||
|
icon: "none",
|
||||||
|
duration: 1200
|
||||||
|
});
|
||||||
|
hidePopup();
|
||||||
|
proxy.refreshData();
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: "失败:" + res.data.message,
|
||||||
|
icon: "none",
|
||||||
|
duration: 2500
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: "服务器返回错误状态码" + res.statusCode,
|
||||||
|
icon: "none",
|
||||||
|
duration: 2500
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
uni.showToast({
|
||||||
|
title: "请求失败" + err,
|
||||||
|
icon: "none",
|
||||||
|
duration: 2500
|
||||||
|
});
|
||||||
|
this.clear();
|
||||||
|
},
|
||||||
|
complete: (event) => {
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
return {
|
||||||
|
fixedInfo,
|
||||||
|
popup,
|
||||||
|
inputValue,
|
||||||
|
showPopup,
|
||||||
|
hidePopup,
|
||||||
|
saveData
|
||||||
|
};
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
locationId: null,
|
||||||
|
locationCode: "",
|
||||||
|
userName: "",
|
||||||
|
//当前登录的用户名
|
||||||
|
recordCount: 0,
|
||||||
|
shelfId: null,
|
||||||
|
shelfCode: "",
|
||||||
|
placeholderText: "请先扫描货架码",
|
||||||
|
matCodeCondition: "",
|
||||||
|
//物料编码搜索条件
|
||||||
|
cardData: null,
|
||||||
|
//监控滑动的位置
|
||||||
|
touchStartX: 0,
|
||||||
|
touchStartY: 0,
|
||||||
|
isMove: false,
|
||||||
|
//滑动标识 是否滑动
|
||||||
|
selectedShelfAreaOption: "",
|
||||||
|
// 初始选中值,可以是空字符串或预定义的值
|
||||||
|
shelfAreaOptions: [
|
||||||
|
// 选项列表
|
||||||
|
{
|
||||||
|
id: 1,
|
||||||
|
value: "type1",
|
||||||
|
text: "类型1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 2,
|
||||||
|
value: "type2",
|
||||||
|
text: "类型2"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 3,
|
||||||
|
value: "type3",
|
||||||
|
text: "类型3"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
shelfTypeOptions: [
|
||||||
|
// 选项列表
|
||||||
|
{
|
||||||
|
id: 1,
|
||||||
|
value: "1",
|
||||||
|
text: "空货架"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 2,
|
||||||
|
value: "2",
|
||||||
|
text: "非空货架"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
selectedShelfTypeOption: ""
|
||||||
|
// 初始选中值,可以是空字符串或预定义的值
|
||||||
|
};
|
||||||
|
},
|
||||||
|
onShow: function() {
|
||||||
|
this.userName = getConfig("userName", "admin");
|
||||||
|
const self = this;
|
||||||
|
recive(function(res) {
|
||||||
|
formatAppLog("log", "at pages/productionLineCallOut/productionLineCallOut.vue:310", "Success:" + res.data);
|
||||||
|
self.analysisScanCode(res.data);
|
||||||
|
}, function(err) {
|
||||||
|
formatAppLog("log", "at pages/productionLineCallOut/productionLineCallOut.vue:313", "Error:", JSON.stringify(err));
|
||||||
|
});
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
refreshData: function() {
|
||||||
|
this.analysisScanCode(this.shelfCode);
|
||||||
|
},
|
||||||
|
analysisScanCode: function(encodedString) {
|
||||||
|
encodedString = encodedString.replace(/,\s*\.\.\.$/, "");
|
||||||
|
this.shelfCode = encodedString;
|
||||||
|
var serverIPAndPort = getServerIPAndPort();
|
||||||
|
uni.request({
|
||||||
|
url: "http://" + serverIPAndPort + "/pdaStocktaking/getStocktakingInfosByShelfCode",
|
||||||
// 请求的接口地址
|
// 请求的接口地址
|
||||||
method: "POST",
|
method: "POST",
|
||||||
// 设置请求方式为 POST
|
// 设置请求方式为 POST
|
||||||
data: {
|
data: {
|
||||||
"shelfCode": this.shelfCode,
|
"shelfCode": this.shelfCode,
|
||||||
"matCode": this.matCodeCondition,
|
|
||||||
"userName": this.userName,
|
"userName": this.userName,
|
||||||
"deviceType": "PDA",
|
"deviceType": "PDA",
|
||||||
"pageNumber": 1,
|
"pageNumber": 1,
|
||||||
"pageSize": 300
|
"pageSize": 1e3
|
||||||
},
|
},
|
||||||
header: {
|
header: {
|
||||||
"Content-Type": "application/json"
|
"Content-Type": "application/json"
|
||||||
@ -4159,7 +4551,7 @@ if (uni.restoreGlobal) {
|
|||||||
this.clear();
|
this.clear();
|
||||||
},
|
},
|
||||||
complete: (event) => {
|
complete: (event) => {
|
||||||
formatAppLog("log", "at pages/productionLineCallIn/productionLineCallIn.vue:443", "请求完成", event);
|
formatAppLog("log", "at pages/productionLineCallOut/productionLineCallOut.vue:393", "请求完成", event);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -4190,9 +4582,9 @@ if (uni.restoreGlobal) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||||
const _component_uni_popup = resolveEasycom(vue.resolveDynamicComponent("uni-popup"), __easycom_0);
|
const _component_uni_popup = resolveEasycom(vue.resolveDynamicComponent("uni-popup"), __easycom_0);
|
||||||
const _component_Card = vue.resolveComponent("Card");
|
const _component_StocktakingCard = vue.resolveComponent("StocktakingCard");
|
||||||
return vue.openBlock(), vue.createElementBlock("view", { class: "bg-image" }, [
|
return vue.openBlock(), vue.createElementBlock("view", { class: "bg-image" }, [
|
||||||
vue.createVNode(
|
vue.createVNode(
|
||||||
_component_uni_popup,
|
_component_uni_popup,
|
||||||
@ -4299,7 +4691,7 @@ if (uni.restoreGlobal) {
|
|||||||
style: { "font-size": "50rpx", "padding": "10rpx" },
|
style: { "font-size": "50rpx", "padding": "10rpx" },
|
||||||
placeholder: $data.placeholderText,
|
placeholder: $data.placeholderText,
|
||||||
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $data.matCodeCondition = $event),
|
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $data.matCodeCondition = $event),
|
||||||
onBlur: _cache[4] || (_cache[4] = (...args) => $options.queryMatList && $options.queryMatList(...args))
|
onBlur: _cache[4] || (_cache[4] = (...args) => _ctx.queryMatList && _ctx.queryMatList(...args))
|
||||||
}, null, 40, ["placeholder"]), [
|
}, null, 40, ["placeholder"]), [
|
||||||
[vue.vModelText, $data.matCodeCondition]
|
[vue.vModelText, $data.matCodeCondition]
|
||||||
])
|
])
|
||||||
@ -4307,7 +4699,7 @@ if (uni.restoreGlobal) {
|
|||||||
vue.createElementVNode("view", { style: { "flex": "3" } }),
|
vue.createElementVNode("view", { style: { "flex": "3" } }),
|
||||||
vue.createElementVNode("view", { style: { "flex": "30" } }, [
|
vue.createElementVNode("view", { style: { "flex": "30" } }, [
|
||||||
vue.createElementVNode("button", {
|
vue.createElementVNode("button", {
|
||||||
onClick: _cache[5] || (_cache[5] = (...args) => $options.queryMatList && $options.queryMatList(...args))
|
onClick: _cache[5] || (_cache[5] = ($event) => $options.analysisScanCode(this.shelfCode))
|
||||||
}, "查询")
|
}, "查询")
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
@ -4321,19 +4713,19 @@ if (uni.restoreGlobal) {
|
|||||||
style: { "margin-top": "5rpx" }
|
style: { "margin-top": "5rpx" }
|
||||||
}, [
|
}, [
|
||||||
vue.createElementVNode("view", { class: "diy-flex-inforow" }, [
|
vue.createElementVNode("view", { class: "diy-flex-inforow" }, [
|
||||||
vue.createElementVNode("view", { style: { "width": "10rpx" } }),
|
|
||||||
vue.createElementVNode(
|
vue.createElementVNode(
|
||||||
"view",
|
"view",
|
||||||
{ style: { "width": "275rpx" } },
|
{ style: { "width": "740" } },
|
||||||
"记录数:[" + vue.toDisplayString($data.recordCount) + "]",
|
"货架码:" + vue.toDisplayString($data.shelfCode),
|
||||||
1
|
1
|
||||||
/* TEXT */
|
/* TEXT */
|
||||||
),
|
)
|
||||||
vue.createElementVNode("view", { style: { "width": "10rpx" } }),
|
]),
|
||||||
|
vue.createElementVNode("view", { class: "diy-flex-inforow" }, [
|
||||||
vue.createElementVNode(
|
vue.createElementVNode(
|
||||||
"view",
|
"view",
|
||||||
{ style: { "width": "455rpx" } },
|
{ style: { "width": "740" } },
|
||||||
"工位码:" + vue.toDisplayString($data.locationCode),
|
"工位码:" + vue.toDisplayString($data.shelfCode),
|
||||||
1
|
1
|
||||||
/* TEXT */
|
/* TEXT */
|
||||||
)
|
)
|
||||||
@ -4357,30 +4749,77 @@ if (uni.restoreGlobal) {
|
|||||||
onTouchmove: _cache[7] || (_cache[7] = (...args) => $options.cardTouchMove && $options.cardTouchMove(...args)),
|
onTouchmove: _cache[7] || (_cache[7] = (...args) => $options.cardTouchMove && $options.cardTouchMove(...args)),
|
||||||
onLongpress: ($event) => $options.longpress(item)
|
onLongpress: ($event) => $options.longpress(item)
|
||||||
}, [
|
}, [
|
||||||
vue.createVNode(_component_Card, {
|
vue.createVNode(_component_StocktakingCard, {
|
||||||
|
class: vue.normalizeClass(_ctx.cardClass(item)),
|
||||||
item,
|
item,
|
||||||
currentIndex: index,
|
currentIndex: index,
|
||||||
cardData: $data.cardData
|
cardData: $data.cardData
|
||||||
}, null, 8, ["item", "currentIndex", "cardData"])
|
}, null, 8, ["class", "item", "currentIndex", "cardData"])
|
||||||
], 40, ["onLongpress"]);
|
], 40, ["onLongpress"]);
|
||||||
}),
|
}),
|
||||||
128
|
128
|
||||||
/* KEYED_FRAGMENT */
|
/* KEYED_FRAGMENT */
|
||||||
))
|
))
|
||||||
])
|
])
|
||||||
|
]),
|
||||||
|
vue.createElementVNode("view", {
|
||||||
|
class: "floating-bar",
|
||||||
|
style: { "position": "fixed", "bottom": "0", "left": "0", "width": "100%", "background-color": "#fff", "display": "flex", "justify-content": "space-between", "align-items": "center", "padding": "10rpx" }
|
||||||
|
}, [
|
||||||
|
vue.withDirectives(vue.createElementVNode(
|
||||||
|
"select",
|
||||||
|
{
|
||||||
|
style: { "width": "200rpx" },
|
||||||
|
"onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => $data.selectedShelfAreaOption = $event)
|
||||||
|
},
|
||||||
|
[
|
||||||
|
(vue.openBlock(true), vue.createElementBlock(
|
||||||
|
vue.Fragment,
|
||||||
|
null,
|
||||||
|
vue.renderList($data.shelfAreaOptions, (area) => {
|
||||||
|
return vue.openBlock(), vue.createElementBlock("option", {
|
||||||
|
value: area.value,
|
||||||
|
key: area.id
|
||||||
|
}, vue.toDisplayString(area.text), 9, ["value"]);
|
||||||
|
}),
|
||||||
|
128
|
||||||
|
/* KEYED_FRAGMENT */
|
||||||
|
))
|
||||||
|
],
|
||||||
|
512
|
||||||
|
/* NEED_PATCH */
|
||||||
|
), [
|
||||||
|
[vue.vModelSelect, $data.selectedShelfAreaOption]
|
||||||
|
]),
|
||||||
|
vue.withDirectives(vue.createElementVNode(
|
||||||
|
"select",
|
||||||
|
{
|
||||||
|
style: { "width": "200rpx" },
|
||||||
|
"onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => $data.selectedShelfTypeOption = $event)
|
||||||
|
},
|
||||||
|
[
|
||||||
|
(vue.openBlock(true), vue.createElementBlock(
|
||||||
|
vue.Fragment,
|
||||||
|
null,
|
||||||
|
vue.renderList($data.shelfTypeOptions, (type1) => {
|
||||||
|
return vue.openBlock(), vue.createElementBlock("option", {
|
||||||
|
value: type1.value,
|
||||||
|
key: type1.id
|
||||||
|
}, vue.toDisplayString(type1.text), 9, ["value"]);
|
||||||
|
}),
|
||||||
|
128
|
||||||
|
/* KEYED_FRAGMENT */
|
||||||
|
))
|
||||||
|
],
|
||||||
|
512
|
||||||
|
/* NEED_PATCH */
|
||||||
|
), [
|
||||||
|
[vue.vModelSelect, $data.selectedShelfTypeOption]
|
||||||
|
]),
|
||||||
|
vue.createElementVNode("button", { style: { "width": "200rpx", "background": "green", "color": "white" } }, "货架送回")
|
||||||
])
|
])
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
const PagesProductionLineCallInProductionLineCallIn = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$1], ["__file", "E:/代码/赛特制冷WCS/wcs/PDA/PDA/pages/productionLineCallIn/productionLineCallIn.vue"]]);
|
|
||||||
const _sfc_main$1 = {
|
|
||||||
data() {
|
|
||||||
return {};
|
|
||||||
},
|
|
||||||
methods: {}
|
|
||||||
};
|
|
||||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
||||||
return vue.openBlock(), vue.createElementBlock("view");
|
|
||||||
}
|
|
||||||
const PagesProductionLineCallOutProductionLineCallOut = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render], ["__file", "E:/代码/赛特制冷WCS/wcs/PDA/PDA/pages/productionLineCallOut/productionLineCallOut.vue"]]);
|
const PagesProductionLineCallOutProductionLineCallOut = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render], ["__file", "E:/代码/赛特制冷WCS/wcs/PDA/PDA/pages/productionLineCallOut/productionLineCallOut.vue"]]);
|
||||||
__definePage("pages/index/index", PagesIndexIndex);
|
__definePage("pages/index/index", PagesIndexIndex);
|
||||||
__definePage("pages/config/config", PagesConfigConfig);
|
__definePage("pages/config/config", PagesConfigConfig);
|
||||||
|
@ -46,6 +46,12 @@ namespace WCS.DAL.DbModels
|
|||||||
[SugarColumn(ColumnName = "allow_shelf_types", Length = 256, IsNullable = true, ColumnDescription = "可放置货架类型", IsJson = true)]
|
[SugarColumn(ColumnName = "allow_shelf_types", Length = 256, IsNullable = true, ColumnDescription = "可放置货架类型", IsJson = true)]
|
||||||
public List<string> AllowShelfTypes { get; set; }
|
public List<string> AllowShelfTypes { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 作为起点时 允许的目的地类型
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "allow_destination_location_area", Length = 512, IsNullable = true, ColumnDescription = "可放置货架类型", IsJson = true)]
|
||||||
|
public List<int> AllowDestinationLocationArea { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 更新人
|
/// 更新人
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -4,7 +4,7 @@ using System.Text;
|
|||||||
|
|
||||||
namespace WCS.Model.ApiModel.PDAProductionLineCallIn
|
namespace WCS.Model.ApiModel.PDAProductionLineCallIn
|
||||||
{
|
{
|
||||||
public class CallInRequest
|
public class CallInRequest:RequestBase
|
||||||
{
|
{
|
||||||
public int LocationId { get; set; }
|
public int LocationId { get; set; }
|
||||||
public string LocationCode { get; set; }
|
public string LocationCode { get; set; }
|
||||||
|
@ -0,0 +1,14 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace WCS.Model.ApiModel.PDAProductionLineCallIn
|
||||||
|
{
|
||||||
|
public class CallOutRequest:RequestBase
|
||||||
|
{
|
||||||
|
public int LocationId { get; set; }
|
||||||
|
public string LocationCode { get; set; }
|
||||||
|
public int ShelfId { get; set; }
|
||||||
|
public string ShelfCode { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@ -225,7 +225,7 @@ namespace WCS.WebApi.Controllers
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[Route("callIn")]
|
[Route("callIn")]
|
||||||
[HttpPost(Name = "callIn")]
|
[HttpPost(Name = "callIn")]
|
||||||
public async Task<ResponseCommon> callIn(CallInRequest request)
|
public async Task<ResponseCommon> callIn(CallOutRequest request)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
256
WCS.WebApi/Controllers/PDAProductionLineCallOutController.cs
Normal file
256
WCS.WebApi/Controllers/PDAProductionLineCallOutController.cs
Normal file
@ -0,0 +1,256 @@
|
|||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using WCS.BLL.DbModels;
|
||||||
|
using WCS.BLL.Services.IService;
|
||||||
|
using WCS.BLL.Services.Service;
|
||||||
|
using WCS.DAL.Db;
|
||||||
|
using WCS.DAL.DbModels;
|
||||||
|
using WCS.Model;
|
||||||
|
using WCS.Model.ApiModel.MatBaseInfo;
|
||||||
|
using WCS.Model.ApiModel.MatDetailCurrentInfo;
|
||||||
|
using WCS.Model.ApiModel.PDAProductionLineCallIn;
|
||||||
|
using WCS.Model.ApiModel.PDAShelfLocationBindUnbind;
|
||||||
|
using WCS.Model.ApiModel.Stocktaking;
|
||||||
|
|
||||||
|
namespace WCS.WebApi.Controllers
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// PDA产线呼叫功能
|
||||||
|
/// </summary>
|
||||||
|
[ApiController]
|
||||||
|
[Route("[controller]")]
|
||||||
|
public class PDAProductionLineCallOutController : ControllerBase
|
||||||
|
{
|
||||||
|
|
||||||
|
public PDAProductionLineCallOutController(IStockTakingService stockTakingService)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取当前货架、当前工位、当前工位可以作为起点可以到的目标区域
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[Route("getMatDetailCurrentInfosForCallOut")]
|
||||||
|
[HttpPost(Name = "getMatDetailCurrentInfosForCallOut")]
|
||||||
|
public async Task<ResponseCommon> getMatDetailCurrentInfosForCallIn(GetMatDetailCurrentInfosForCallInRequest request)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
#region 校验位置是否可以呼叫货架
|
||||||
|
if (request.LocationId == 0)
|
||||||
|
{
|
||||||
|
return new ResponseCommon()
|
||||||
|
{
|
||||||
|
Code = 201,
|
||||||
|
Message = $"参数错误:请重新扫描工位码!",
|
||||||
|
Data = null,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
//获取位置信息
|
||||||
|
var locationInfo = await DbHelp.db.Queryable<LocationInfo>()
|
||||||
|
.Where(t => t.Id == request.LocationId)
|
||||||
|
.FirstAsync();
|
||||||
|
if (locationInfo == null)
|
||||||
|
{
|
||||||
|
return new ResponseCommon()
|
||||||
|
{
|
||||||
|
Code = 201,
|
||||||
|
Message = $"获取失败:工位{request.LocationCode}不存在!",
|
||||||
|
Data = null,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
if (locationInfo.IsEnable == false)
|
||||||
|
{
|
||||||
|
return new ResponseCommon()
|
||||||
|
{
|
||||||
|
Code = 201,
|
||||||
|
Message = $"获取失败:工位{locationInfo.LocationCode}已被禁用!",
|
||||||
|
Data = null,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
var shelfInfo = await DbHelp.db.Queryable<ShelfInfo>()
|
||||||
|
.Where(t => t.CurrentLocationId == locationInfo.Id)
|
||||||
|
.FirstAsync();
|
||||||
|
if (shelfInfo != null)
|
||||||
|
{
|
||||||
|
return new ResponseCommon()
|
||||||
|
{
|
||||||
|
Code = 301,
|
||||||
|
Message = $"获取失败:工位{locationInfo.LocationCode}已被货架{shelfInfo.ShelfCode}占用!",
|
||||||
|
Data = null,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 查询货架当前存量
|
||||||
|
var recordsQueryable = DbHelp.db.Queryable<MatDetailCurrentInfo>()
|
||||||
|
.LeftJoin<ShelfInfo>((mci, si) => mci.ShelfId == si.Id)
|
||||||
|
//货架状态是静止的 代表这个货架没有被呼叫走哦
|
||||||
|
.LeftJoin<LocationInfo>((mci, si, li) => (si.TransStatus == TransStatusEnum.静止 && si.CurrentLocationId == li.Id))
|
||||||
|
.WhereIF(!string.IsNullOrEmpty(request.MatCodeCondition), (mci, si, li) => mci.MatCode.Contains(request.MatCodeCondition))
|
||||||
|
.Select((mci, si, li) => new MatDetailCurrentInfoModel()
|
||||||
|
{
|
||||||
|
Id = mci.Id,
|
||||||
|
ShelfId = mci.ShelfId,
|
||||||
|
ShelfCode = mci.ShelfCode,
|
||||||
|
ShelfType = mci.ShelfType,
|
||||||
|
|
||||||
|
LocationArea = li.LocationArea,
|
||||||
|
LocationCode = li.LocationCode,
|
||||||
|
|
||||||
|
MatCode = mci.MatCode,
|
||||||
|
MatName = mci.MatName,
|
||||||
|
MatSpec = mci.MatSpec,
|
||||||
|
MatUnit = mci.MatUnit,
|
||||||
|
MatCustomer = mci.MatCustomer,
|
||||||
|
MatQty = mci.MatQty,
|
||||||
|
MatSupplier = mci.MatSupplier,
|
||||||
|
|
||||||
|
StationCode = mci.StationCode,
|
||||||
|
ModifyUser = mci.ModifyUser,
|
||||||
|
ModifyTime = mci.ModifyTime
|
||||||
|
});
|
||||||
|
|
||||||
|
//分页
|
||||||
|
var totalCount = await recordsQueryable.CountAsync();
|
||||||
|
var records = await recordsQueryable
|
||||||
|
.OrderByDescending(mci => mci.Id)
|
||||||
|
.Skip((1 - 1) * 300).Take(300)
|
||||||
|
.ToListAsync();
|
||||||
|
return new PageQueryResponse<MatDetailCurrentInfoModel>()
|
||||||
|
{
|
||||||
|
Code = 200,
|
||||||
|
Message = $"success",
|
||||||
|
Data = new PageQueryResponseData<MatDetailCurrentInfoModel>()
|
||||||
|
{
|
||||||
|
TotalCount = totalCount,
|
||||||
|
MaxPage = 1,
|
||||||
|
Count = records.Count,
|
||||||
|
Lists = records.ToList()
|
||||||
|
}
|
||||||
|
};
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
return new ResponseCommon()
|
||||||
|
{
|
||||||
|
Code = 201,
|
||||||
|
Message = ex.Message,
|
||||||
|
Data = null,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 货架送回 通过 货架ID 目标区域 是否为空货架 将货架送回
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[Route("callOut")]
|
||||||
|
[HttpPost(Name = "callOut")]
|
||||||
|
public async Task<ResponseCommon> callIn(CallOutRequest request)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
#region 校验位置是否可以呼叫货架
|
||||||
|
if (request.LocationId == 0)
|
||||||
|
{
|
||||||
|
return new ResponseCommon()
|
||||||
|
{
|
||||||
|
Code = 201,
|
||||||
|
Message = $"呼叫失败:请重新扫描工位码!",
|
||||||
|
Data = null,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
//获取位置信息
|
||||||
|
var locationInfo = await DbHelp.db.Queryable<LocationInfo>()
|
||||||
|
.Where(t => t.Id == request.LocationId)
|
||||||
|
.FirstAsync();
|
||||||
|
if (locationInfo == null)
|
||||||
|
{
|
||||||
|
return new ResponseCommon()
|
||||||
|
{
|
||||||
|
Code = 201,
|
||||||
|
Message = $"呼叫失败:工位{request.LocationCode}不存在!",
|
||||||
|
Data = null,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
if (locationInfo.IsEnable == false)
|
||||||
|
{
|
||||||
|
return new ResponseCommon()
|
||||||
|
{
|
||||||
|
Code = 201,
|
||||||
|
Message = $"呼叫失败:工位{locationInfo.LocationCode}已被禁用!",
|
||||||
|
Data = null,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
var shelfInfo = await DbHelp.db.Queryable<ShelfInfo>()
|
||||||
|
.Where(t => t.CurrentLocationId == locationInfo.Id)
|
||||||
|
.FirstAsync();
|
||||||
|
if (shelfInfo != null)
|
||||||
|
{
|
||||||
|
return new ResponseCommon()
|
||||||
|
{
|
||||||
|
Code = 301,
|
||||||
|
Message = $"呼叫失败:工位{locationInfo.LocationCode}已被货架{shelfInfo.ShelfCode}占用!",
|
||||||
|
Data = null,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 获取货架是否可以被呼叫
|
||||||
|
shelfInfo = await DbHelp.db.Queryable<ShelfInfo>()
|
||||||
|
.Where(t => t.Id == request.ShelfId)
|
||||||
|
.Where(t => t.IsEnable)
|
||||||
|
.FirstAsync();
|
||||||
|
if (shelfInfo == null)
|
||||||
|
{
|
||||||
|
return new ResponseCommon()
|
||||||
|
{
|
||||||
|
Code = 201,
|
||||||
|
Message = $"呼叫失败:货架{shelfInfo.ShelfCode}不存在或已被禁用!",
|
||||||
|
Data = null,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (shelfInfo.TransStatus == TransStatusEnum.运输中)
|
||||||
|
{
|
||||||
|
return new ResponseCommon()
|
||||||
|
{
|
||||||
|
Code = 201,
|
||||||
|
Message = $"呼叫失败:货架{shelfInfo.ShelfCode}正在运输中!",
|
||||||
|
Data = null,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region
|
||||||
|
//TO DO 调用AGV接口开始呼叫 呼叫成功更新运输状态和目标库位
|
||||||
|
|
||||||
|
return new ResponseCommon()
|
||||||
|
{
|
||||||
|
Code = 200,
|
||||||
|
Message = $"呼叫成功!",
|
||||||
|
Data = null,
|
||||||
|
};
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
return new ResponseCommon()
|
||||||
|
{
|
||||||
|
Code = 201,
|
||||||
|
Message = ex.Message,
|
||||||
|
Data = null,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user