les功能提交

This commit is contained in:
2025-12-19 16:40:25 +08:00
parent 54ec472bd4
commit 23da00a8f0
14 changed files with 814 additions and 165 deletions

126
pages/les/bindMaterial.vue Normal file
View File

@@ -0,0 +1,126 @@
<template>
<view>
<uni-forms ref="form" :modelValue="formData" :rules="rules">
<uni-forms-item label="货位号:" name="locationCode">
<uni-easyinput suffixIcon="scan" @iconClick="scanLocationCodeUuid" type="text"
v-model="formData.locationCode" />
</uni-forms-item>
<uni-forms-item label="批次号:" name="batchNo">
<uni-easyinput suffixIcon="scan" @iconClick="scanBatchNoUuid" type="text" v-model="formData.batchNo" />
</uni-forms-item>
</uni-forms>
<uni-row :gutter="10">
<uni-col :span="12">
<u-button type="success" @click="handleBind">绑定</u-button>
</uni-col>
<uni-col :span="12">
<u-button type="primary" @click="handleUnBind">解绑</u-button>
</uni-col>
</uni-row>
</view>
</template>
<script>
import { bind, unBind } from "@/api/les/lesMaterialBind.js";
export default {
data() {
return {
formData: {},
/** 校验规则 */
rules: {
locationCode: {
rules: [{
required: true,
errorMessage: '请输入货位号',
}, ]
},
batchNo: {
rules: [{
required: true,
errorMessage: '请选择批次号',
}, ]
},
},
}
},
methods: {
scanLocationCodeUuid() {
const _this = this;
uni.scanCode({
scanType: ['qrCode', 'barCode'],
success: function(res) {
_this.formData.locationCode = res.result;
}
});
},
scanBatchNoUuid() {
const _this = this;
uni.scanCode({
scanType: ['qrCode', 'barCode'],
success: function(res) {
_this.formData.batchNo = res.result;
}
});
},
handleBind() {
const _this = this;
this.$refs.form.validate().then(res => {
uni.showModal({
title: '提示',
content: '您确定绑定该数据吗?',
success: function(res) {
if (res.confirm) {
if (_this.formData.locationCode && _this.formData.batchNo) {
_this.$modal.loading('绑定中')
bind(_this.formData).then(res => {
_this.$modal.closeLoading();
_this.$modal.msgSuccess("绑定成功!");
setTimeout(() => {
this.$tab.switchTab("/pages/work/index");
}, 500);
})
} else {
_this.$modal.msg("请将信息补充完整")
}
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
})
},
handleUnBind() {
const _this = this;
this.$refs.form.validate().then(res => {
uni.showModal({
title: '提示',
content: '您确定解绑该数据吗?',
success: function(res) {
if (res.confirm) {
if (_this.formData.locationCode) {
_this.$modal.loading('解绑中')
unBind(_this.formData.locationCode).then(res => {
_this.$modal.closeLoading();
_this.$modal.msgSuccess("解绑成功!")
setTimeout(() => {
this.$tab.switchTab("/pages/work/index");
}, 500);
})
} else {
_this.$modal.msg("请将信息补充完整")
}
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
})
},
// reset() {
// this.formData = {};
// }
}
}
</script>

View File

@@ -0,0 +1,96 @@
<template>
<view>
<uni-forms ref="form" :modelValue="formData" :rules="rules">
<uni-forms-item label="发货点位:" :labelWidth='90' name="srcLocationCode">
<uni-easyinput type="text" v-model="formData.srcLocationCode" />
</uni-forms-item>
<uni-forms-item label="目的货位:" :labelWidth='90' name="destLocationCode">
<uni-easyinput suffixIcon="scan" @iconClick="scanDestLocationUuid" type="text" @blur="searchSrcLocation"
v-model="formData.destLocationCode" />
</uni-forms-item>
</uni-forms>
<uni-row :gutter="10">
<uni-col>
<u-button type="success" @click="handleCall">呼叫</u-button>
</uni-col>
</uni-row>
</view>
</template>
<script>
import { addDeliveryTask, findPreparation } from "@/api/les/lesMaterialCall.js";
import LesDeliveryTaskType from "@/utils/enums/LesDeliveryTaskType";
export default {
data() {
return {
formData: {
taskType: LesDeliveryTaskType.PRODUCTION
},
/** 校验规则 */
rules: {
srcLocationCode: {
rules: [{
required: true,
errorMessage: '请输入发货点位',
}, ]
},
destLocationCode: {
rules: [{
required: true,
errorMessage: '请选择目的货位',
}, ]
},
},
}
},
methods: {
searchSrcLocation() {
const _this = this;
if (_this.formData.destLocationCode == '') {
return;
}
findPreparation(_this.formData.destLocationCode).then(res => {
if (res.code == 200) {
this.$set(this.formData, "srcLocationCode", res.data);
} else {
this.$modal.showToast("未找到对应发货点位")
}
})
},
scanDestLocationUuid() {
const _this = this;
uni.scanCode({
scanType: ['qrCode', 'barCode'],
success: function(res) {
_this.formData.destLocationCode = res.result;
_this.searchSrcLocation();
}
});
},
handleCall() {
const _this = this;
this.$refs.form.validate().then(res => {
if (_this.formData.srcLocationCode && _this.formData.destLocationCode) {
_this.$modal.loading('提交中')
addDeliveryTask(_this.formData).then(res => {
_this.$modal.closeLoading();
_this.$modal.msgSuccess("提交成功!");
setTimeout(() => {
_this.$tab.switchTab("/pages/work/index");
}, 500);
})
} else {
_this.$modal.msg("请将信息补充完整")
}
})
},
// reset() {
// const _this = this;
// this.formData.srcLocationCode = '';
// this.formData.destLocationCode = '';
// }
}
}
</script>

49
pages/les/chooseTask.vue Normal file
View File

@@ -0,0 +1,49 @@
<template>
<view class="cu-card article ">
<view class="cu-item shadow borderBottom" v-for="(item,index) in list" :key="index">
<view class="title">
<view class="text-cut">任务类型 : {{item.taskType}}</view>
<view>
<button type="primary" size="mini" @click="choose(item)" style="float: right;">选择任务</button>
</view>
</view>
<view class="content">
<view class="desc">
<view class="text-content">
<view>发货点位 : {{item.srcLocationCode}}</view>
<view>目的点位 : {{item.destLocationCode}}</view>
<view>物料编码 : {{item.material.materialCode}}</view>
<view>物料名称 : {{item.material.materialName}}</view>
<view>呼叫时间 : {{item.callDatetime}}</view>
<view>状态 : {{item.taskStatus}}</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import { listData } from "@/api/les/lesMaterialDelivery.js"
export default {
data() {
return {
list: {},
}
},
created() {
this.getList();
},
methods: {
getList() {
listData().then(res => {
this.list = res.rows;
})
},
choose(data) {
this.$tab.navigateTo("/pages/les/deliveryMaterial?formData=" + JSON.stringify(data));
}
}
}
</script>

View File

@@ -0,0 +1,115 @@
<template>
<view>
<uni-forms ref="form" :modelValue="formData" :rules="rules">
<uni-forms-item label="发货点位:" :labelWidth='100' name="srcLocationCode">
<uni-easyinput type="text" v-model="formData.srcLocationCode" />
</uni-forms-item>
<uni-forms-item label="目的点位:" :labelWidth='100' name="destLocationCode">
<uni-easyinput type="text" v-model="formData.destLocationCode" />
</uni-forms-item>
<uni-forms-item label="机器人类型:" :labelWidth='100' name="RobotType">
<uni-data-select placeholder="请选择机器类型" v-model="formData.RobotType" :localdata="RobotData" />
</uni-forms-item>
<uni-forms-item label="容器类型:" :labelWidth='100' name="ctnrTyp" v-if="formData.RobotType == 2">
<uni-easyinput type="text" v-model="formData.ctnrTyp" />
</uni-forms-item>
</uni-forms>
<uni-row :gutter="10">
<uni-col :span="12">
<u-button type="success" @click="handleDelivery">配送</u-button>
</uni-col>
<uni-col :span="12">
<u-button type="primary" @click="handleCancle">取消</u-button>
</uni-col>
</uni-row>
</view>
</template>
<script>
import RobotType from "@/utils/enums/RobotType";
import { delivery, cancel } from "@/api/les/lesMaterialDelivery.js"
export default {
onLoad(option) {
this.formData = JSON.parse(option.formData);
},
data() {
return {
formData: {},
RobotData: [
{ value: RobotType.LATENT_MOBILE_ROBOT, text: "潜伏车" },
{ value: RobotType.LATENT_FORKLIFT_AGV, text: "潜伏叉车" },
],
/** 校验规则 */
rules: {
srcLocationCode: {
rules: [{
required: true,
errorMessage: '请输入发货点位',
}, ]
},
destLocationCode: {
rules: [{
required: true,
errorMessage: '请输入目的货位',
}, ]
},
RobotType: {
rules: [{
required: true,
errorMessage: '请选择机器人类型',
}, ]
},
},
}
},
methods: {
handleDelivery() {
const _this = this;
this.$refs.form.validate().then(res => {
if (_this.formData.srcLocationCode && _this.formData.destLocationCode) {
_this.$modal.loading('提交中')
delivery(_this.formData).then(res => {
_this.$modal.closeLoading();
_this.$modal.msgSuccess("提交成功!");
_this.reset();
setTimeout(() => {
this.$tab.switchTab("/pages/les/chooseTask");
}, 500);
})
} else {
_this.$modal.msg("请将信息补充完整")
}
})
},
handleCancle() {
const _this = this;
const arr = [];
arr.push(_this.formData.id);
this.$refs.form.validate().then(res => {
uni.showModal({
title: '提示',
content: '您确定取消该任务吗?',
success: function(res) {
if (res.confirm) {
_this.$modal.loading('取消中')
cancel(arr).then(res => {
_this.$modal.closeLoading();
_this.$modal.msgSuccess("取消成功!");
_this.reset();
setTimeout(() => {
this.$tab.switchTab("/pages/les/chooseTask");
}, 500);
})
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
})
},
// reset() {
// this.formData = {};
// }
}
}
</script>

View File

@@ -0,0 +1,88 @@
<template>
<view>
<uni-forms ref="form" :modelValue="formData" :rules="rules">
<uni-forms-item label="发货点位:" :labelWidth='90' name="srcLocationCode">
<uni-easyinput type="text" suffixIcon="scan" @iconClick="scanSrcLocationUuid"
v-model="formData.srcLocationCode" />
</uni-forms-item>
<uni-forms-item label="目的点位:" :labelWidth='90' name="destLocationCode">
<uni-easyinput type="text" v-model="formData.destLocationCode" />
</uni-forms-item>
</uni-forms>
<uni-row :gutter="10">
<uni-col>
<u-button type="success" @click="handleCall">呼叫</u-button>
</uni-col>
</uni-row>
</view>
</template>
<script>
import { addDeliveryTask, getLastPalletRecyclingDest } from "@/api/les/lesPalletReturn.js";
import LesDeliveryTaskType from "@/utils/enums/LesDeliveryTaskType";
export default {
data() {
return {
formData: {
taskType: LesDeliveryTaskType.PALLET_RECYCLING
},
/** 校验规则 */
rules: {
srcLocationCode: {
rules: [{
required: true,
errorMessage: '请选择发货点位',
}, ]
},
destLocationCode: {
rules: [{
required: true,
errorMessage: '请选择目的货位',
}, ]
},
},
}
},
created() {
getLastPalletRecyclingDest().then(res => {
if (res.code == 200) {
this.$set(this.formData, "destLocationCode", res.data);
}
})
},
methods: {
scanSrcLocationUuid() {
const _this = this;
uni.scanCode({
scanType: ['qrCode', 'barCode'],
success: function(res) {
_this.formData.destLocationCode = res.result;
}
});
},
handleCall() {
const _this = this;
this.$refs.form.validate().then(res => {
if (_this.formData.srcLocationCode && _this.formData.destLocationCode) {
_this.$modal.loading('提交中')
addDeliveryTask(_this.formData).then(res => {
_this.$modal.closeLoading();
_this.$modal.msgSuccess("提交成功!");
setTimeout(() => {
this.$tab.switchTab("/pages/work/index");
}, 500);
})
} else {
_this.$modal.msg("请将信息补充完整")
}
})
},
// reset() {
// const _this = this;
// this.formData.srcLocationCode = '';
// this.formData.destLocationCode = '';
// }
}
}
</script>