'修改完成'

This commit is contained in:
2025-12-22 09:48:01 +08:00
parent 23da00a8f0
commit 5868f8fab9
5 changed files with 63 additions and 38 deletions

View File

@@ -5,12 +5,12 @@
<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-easyinput type="text" v-model="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 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-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>
@@ -30,11 +30,22 @@ import RobotType from "@/utils/enums/RobotType";
import { delivery, cancel } from "@/api/les/lesMaterialDelivery.js"
export default {
onLoad(option) {
this.formData = JSON.parse(option.formData);
const form = JSON.parse(option.formData);
this.formData.taskTyp = form.taskType;
this.formData.id = form.id;
this.formData.srcLocationCode = form.srcLocationCode;
this.destLocationCode = form.destLocationCode;
},
data() {
return {
formData: {},
formData: {
id: null,
srcLocationCode: null,
taskTyp: null,
robotType: null,
ctnrTyp: null,
},
destLocationCode: null,
RobotData: [
{ value: RobotType.LATENT_MOBILE_ROBOT, text: "潜伏车" },
{ value: RobotType.LATENT_FORKLIFT_AGV, text: "潜伏叉车" },
@@ -47,12 +58,6 @@ export default {
errorMessage: '请输入发货点位',
}, ]
},
destLocationCode: {
rules: [{
required: true,
errorMessage: '请输入目的货位',
}, ]
},
RobotType: {
rules: [{
required: true,
@@ -66,14 +71,14 @@ export default {
handleDelivery() {
const _this = this;
this.$refs.form.validate().then(res => {
if (_this.formData.srcLocationCode && _this.formData.destLocationCode) {
if (_this.formData.srcLocationCode && this.formData.robotType) {
_this.$modal.loading('提交中')
delivery(_this.formData).then(res => {
_this.$modal.closeLoading();
_this.$modal.msgSuccess("提交成功!");
_this.reset();
setTimeout(() => {
this.$tab.switchTab("/pages/les/chooseTask");
this.$tab.switchTab("/pages/work/index");
}, 500);
})
} else {
@@ -97,7 +102,7 @@ export default {
_this.$modal.msgSuccess("取消成功!");
_this.reset();
setTimeout(() => {
this.$tab.switchTab("/pages/les/chooseTask");
this.$tab.switchTab("/pages/work/index");
}, 500);
})
} else if (res.cancel) {
@@ -107,9 +112,16 @@ export default {
});
})
},
// reset() {
// this.formData = {};
// }
reset() {
this.formData = {
id: null,
srcLocationCode: null,
taskTyp: null,
robotType: null,
ctnrTyp: null,
};
this.destLocationCode = null;
}
}
}
</script>