hgwms-2098 fix 任务路径弹窗修改
parent
f5751c70d9
commit
0e204f5cee
|
|
@ -1,264 +1,369 @@
|
||||||
<template>
|
<template>
|
||||||
<a-modal :open="visible" title="编辑区域出入口信息" cancelText="取消" okText="提交" @ok="submit" @cancel="cancel">
|
<a-modal
|
||||||
<a-form ref="formRef" :model="formState" :rules="formRules" :label-col="labelCol" :wrapper-col="wrapperCol">
|
:open="visible"
|
||||||
<a-form-item ref="equipCode" label="设备号" name="equipCode">
|
title="编辑区域出入口信息"
|
||||||
<a-input v-model:value="formState.equipCode" placeholder="请输入设备号" />
|
cancelText="取消"
|
||||||
</a-form-item>
|
okText="提交"
|
||||||
<a-form-item ref="sourceLoc" label="起始地址" name="sourceLoc">
|
@ok="submit"
|
||||||
<a-input v-model:value="formState.sourceLoc" placeholder="请输入起始地址" />
|
@cancel="cancel"
|
||||||
</a-form-item>
|
>
|
||||||
<a-form-item ref="targetLoc" label="目标地址" name="targetLoc">
|
<a-form
|
||||||
<a-input v-model:value="formState.targetLoc" placeholder="请输入目标地址" />
|
ref="formRef"
|
||||||
</a-form-item>
|
:model="formState"
|
||||||
<a-form-item ref="equipType" label="设备类型" name="equipType">
|
:rules="formRules"
|
||||||
<a-select v-model:value="formState.equipType" :options="equipTypes" placeholder="请选择设备类型" />
|
layout="vertical"
|
||||||
</a-form-item>
|
>
|
||||||
<a-form-item ref="ext3" label="任务类型" name="ext3">
|
<a-row :gutter="[16, 0]">
|
||||||
<a-select v-model:value="formState.ext3" :options="taskTypes" placeholder="任务类型" />
|
<a-col :span="12">
|
||||||
</a-form-item>
|
<a-form-item ref="equipCode" label="设备号" name="equipCode">
|
||||||
<a-form-item ref="exitDesc" label="路径描述" name="exitDesc">
|
<a-input
|
||||||
<a-input v-model:value="formState.exitDesc" placeholder="请输入路径描述" />
|
v-model:value="formState.equipCode"
|
||||||
</a-form-item>
|
placeholder="请输入设备号"
|
||||||
<a-form-item ref="directFlag" label="方向标志" name="directFlag">
|
/>
|
||||||
<a-select v-model:value="formState.directFlag" :options="directFlags" placeholder="请选择方向标志" />
|
</a-form-item>
|
||||||
</a-form-item>
|
</a-col>
|
||||||
<a-form-item ref="taskLimit" label="任务数限制" name="taskLimit">
|
<a-col :span="12">
|
||||||
<a-input-number v-model:value="formState.taskLimit" placeholder="请输入任务数限制" style="width: 100%;"/>
|
<a-form-item ref="sourceLoc" label="起始地址" name="sourceLoc">
|
||||||
</a-form-item>
|
<a-input
|
||||||
<a-form-item ref="equipStatus" label="设备状态" name="equipStatus">
|
v-model:value="formState.sourceLoc"
|
||||||
<a-select v-model:value="formState.equipStatus" :options="equipStatusOptions" placeholder="请选择设备状态" />
|
placeholder="请输入起始地址"
|
||||||
</a-form-item>
|
/>
|
||||||
<a-form-item ref="logicStatus" label="逻辑状态" name="logicStatus">
|
</a-form-item>
|
||||||
<a-select v-model:value="formState.logicStatus" :options="logicStatusOptions" placeholder="请选择逻辑状态" :disabled="true" />
|
</a-col>
|
||||||
</a-form-item>
|
<a-col :span="12">
|
||||||
<a-form-item label="备注" name="remark">
|
<a-form-item ref="targetLoc" label="目标地址" name="targetLoc">
|
||||||
<a-textarea v-model:value="formState.remark" />
|
<a-input
|
||||||
</a-form-item>
|
v-model:value="formState.targetLoc"
|
||||||
|
placeholder="请输入目标地址"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item ref="equipType" label="设备类型" name="equipType">
|
||||||
|
<a-select
|
||||||
|
v-model:value="formState.equipType"
|
||||||
|
:options="equipTypes"
|
||||||
|
placeholder="请选择设备类型"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item ref="ext3" label="任务类型" name="ext3">
|
||||||
|
<a-select
|
||||||
|
v-model:value="formState.ext3"
|
||||||
|
:options="taskTypes"
|
||||||
|
placeholder="任务类型"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item ref="exitDesc" label="路径描述" name="exitDesc">
|
||||||
|
<a-input
|
||||||
|
v-model:value="formState.exitDesc"
|
||||||
|
placeholder="请输入路径描述"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item ref="directFlag" label="方向标志" name="directFlag">
|
||||||
|
<a-select
|
||||||
|
v-model:value="formState.directFlag"
|
||||||
|
:options="directFlags"
|
||||||
|
placeholder="请选择方向标志"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item ref="taskLimit" label="任务数限制" name="taskLimit">
|
||||||
|
<a-input-number
|
||||||
|
v-model:value="formState.taskLimit"
|
||||||
|
placeholder="请输入任务数限制"
|
||||||
|
style="width: 100%"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item ref="equipStatus" label="设备状态" name="equipStatus">
|
||||||
|
<a-select
|
||||||
|
v-model:value="formState.equipStatus"
|
||||||
|
:options="equipStatusOptions"
|
||||||
|
placeholder="请选择设备状态"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item ref="logicStatus" label="逻辑状态" name="logicStatus">
|
||||||
|
<a-select
|
||||||
|
v-model:value="formState.logicStatus"
|
||||||
|
:options="logicStatusOptions"
|
||||||
|
placeholder="请选择逻辑状态"
|
||||||
|
:disabled="true"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="备注" name="remark">
|
||||||
|
<a-textarea v-model:value="formState.remark" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
</a-form>
|
</a-form>
|
||||||
</a-modal>
|
</a-modal>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import {
|
import { message } from "@hwork/ant-design-vue";
|
||||||
message
|
import { edit } from "@/api/wms/locExit";
|
||||||
} from '@hwork/ant-design-vue';
|
import { defineComponent, reactive, ref, toRaw, watch } from "vue";
|
||||||
import {
|
export default defineComponent({
|
||||||
edit
|
props: {
|
||||||
} from "@/api/wms/locExit";
|
visible: {
|
||||||
import {
|
type: Boolean,
|
||||||
defineComponent,
|
|
||||||
reactive,
|
|
||||||
ref,
|
|
||||||
toRaw,
|
|
||||||
watch
|
|
||||||
} from "vue";
|
|
||||||
export default defineComponent({
|
|
||||||
props: {
|
|
||||||
visible: {
|
|
||||||
type: Boolean,
|
|
||||||
},
|
|
||||||
record: {
|
|
||||||
type: Object,
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
emit: ["close"],
|
record: {
|
||||||
setup(props, context) {
|
type: Object,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
emit: ["close"],
|
||||||
|
setup(props, context) {
|
||||||
|
const formRef = ref();
|
||||||
|
|
||||||
const formRef = ref();
|
const formState = reactive({});
|
||||||
|
|
||||||
const formState = reactive({});
|
const taskTypes = ref([
|
||||||
|
{
|
||||||
|
value: "In",
|
||||||
|
label: "入库",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "Out",
|
||||||
|
label: "出库",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "Move",
|
||||||
|
label: "移库",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "CheckOut",
|
||||||
|
label: "抽检出库",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "CheckReturn",
|
||||||
|
label: "抽检返库",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "InventoryOut",
|
||||||
|
label: "盘点出库",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "InventoryReturn",
|
||||||
|
label: "盘点返库",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "EmptyIn",
|
||||||
|
label: "空托入库",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "EmptyOut",
|
||||||
|
label: "空托出库",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "PickReturn",
|
||||||
|
label: "拣选返库",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "MoveCommand",
|
||||||
|
label: "单机移动指令",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "EmptyRackCall",
|
||||||
|
label: "空工装呼叫",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "LineCall",
|
||||||
|
label: "线边叫料",
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
|
||||||
const taskTypes = ref([{
|
const equipTypes = ref([
|
||||||
value: 'In',
|
{
|
||||||
label: '入库',
|
value: "Stacker",
|
||||||
}, {
|
label: "堆垛机",
|
||||||
value: 'Out',
|
},
|
||||||
label: '出库',
|
{
|
||||||
}, {
|
value: "Station",
|
||||||
value: 'Move',
|
label: "站台",
|
||||||
label: '移库',
|
},
|
||||||
}, {
|
{
|
||||||
value: 'CheckOut',
|
value: "Conveyer",
|
||||||
label: '抽检出库',
|
label: "小车",
|
||||||
}, {
|
},
|
||||||
value: 'CheckReturn',
|
{
|
||||||
label: '抽检返库',
|
value: "Agv",
|
||||||
}, {
|
label: "AGV",
|
||||||
value: 'InventoryOut',
|
},
|
||||||
label: '盘点出库',
|
]);
|
||||||
}, {
|
|
||||||
value: 'InventoryReturn',
|
|
||||||
label: '盘点返库',
|
|
||||||
}, {
|
|
||||||
value: 'EmptyIn',
|
|
||||||
label: '空托入库',
|
|
||||||
}, {
|
|
||||||
value: 'EmptyOut',
|
|
||||||
label: '空托出库',
|
|
||||||
}, {
|
|
||||||
value: 'PickReturn',
|
|
||||||
label: '拣选返库',
|
|
||||||
}, {
|
|
||||||
value: 'MoveCommand',
|
|
||||||
label: '单机移动指令',
|
|
||||||
}, {
|
|
||||||
value: 'EmptyRackCall',
|
|
||||||
label: '空工装呼叫',
|
|
||||||
}, {
|
|
||||||
value: 'LineCall',
|
|
||||||
label: '线边叫料',
|
|
||||||
}]);
|
|
||||||
|
|
||||||
const equipTypes = ref([{
|
const directFlags = ref([
|
||||||
value: 'Stacker',
|
{
|
||||||
label: '堆垛机',
|
value: "In",
|
||||||
}, {
|
label: "向里",
|
||||||
value: 'Station',
|
},
|
||||||
label: '站台',
|
{
|
||||||
}, {
|
value: "Out",
|
||||||
value: 'Conveyer',
|
label: "向外",
|
||||||
label: '小车',
|
},
|
||||||
}, {
|
{
|
||||||
value: 'Agv',
|
value: "Move",
|
||||||
label: 'AGV',
|
label: "移动",
|
||||||
}]);
|
},
|
||||||
|
]);
|
||||||
|
|
||||||
const directFlags = ref([{
|
const equipStatusOptions = ref([
|
||||||
value: 'In',
|
{
|
||||||
label: '向里',
|
|
||||||
}, {
|
|
||||||
value: 'Out',
|
|
||||||
label: '向外',
|
|
||||||
}, {
|
|
||||||
value: 'Move',
|
|
||||||
label: '移动',
|
|
||||||
}]);
|
|
||||||
|
|
||||||
const equipStatusOptions = ref([{
|
|
||||||
value: true,
|
value: true,
|
||||||
label: '是',
|
label: "是",
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
value: false,
|
value: false,
|
||||||
label: '否',
|
label: "否",
|
||||||
}]);
|
},
|
||||||
|
]);
|
||||||
|
|
||||||
const logicStatusOptions = ref([{
|
const logicStatusOptions = ref([
|
||||||
|
{
|
||||||
value: true,
|
value: true,
|
||||||
label: '是',
|
label: "是",
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
value: false,
|
value: false,
|
||||||
label: '否',
|
label: "否",
|
||||||
}]);
|
},
|
||||||
|
]);
|
||||||
|
|
||||||
watch(props, (props) => {
|
watch(props, (props) => {
|
||||||
console.log("props.record",props.record)
|
console.log("props.record", props.record);
|
||||||
formState.id = props.record.id
|
formState.id = props.record.id;
|
||||||
formState.equipCode = props.record.equipCode;
|
formState.equipCode = props.record.equipCode;
|
||||||
formState.sourceLoc = props.record.sourceLoc;
|
formState.sourceLoc = props.record.sourceLoc;
|
||||||
formState.targetLoc = props.record.targetLoc;
|
formState.targetLoc = props.record.targetLoc;
|
||||||
formState.equipType = props.record.equipType;
|
formState.equipType = props.record.equipType;
|
||||||
formState.exitDesc = props.record.exitDesc;
|
formState.exitDesc = props.record.exitDesc;
|
||||||
formState.directFlag = props.record.directFlag;
|
formState.directFlag = props.record.directFlag;
|
||||||
formState.taskLimit = props.record.taskLimit;
|
formState.taskLimit = props.record.taskLimit;
|
||||||
formState.equipStatus = props.record.equipStatus;
|
formState.equipStatus = props.record.equipStatus;
|
||||||
formState.logicStatus = props.record.logicStatus;
|
formState.logicStatus = props.record.logicStatus;
|
||||||
formState.remark = props.record.remark;
|
formState.remark = props.record.remark;
|
||||||
})
|
});
|
||||||
|
|
||||||
const formRules = {
|
const formRules = {
|
||||||
equipCode: [{
|
equipCode: [
|
||||||
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: '请输入设备号(必填)',
|
message: "请输入设备号(必填)",
|
||||||
trigger: 'blur'
|
trigger: "blur",
|
||||||
}],
|
},
|
||||||
sourceLoc: [{
|
],
|
||||||
|
sourceLoc: [
|
||||||
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: '请输入起始地址(必填)',
|
message: "请输入起始地址(必填)",
|
||||||
trigger: 'blur'
|
trigger: "blur",
|
||||||
}],
|
},
|
||||||
targetLoc: [{
|
],
|
||||||
|
targetLoc: [
|
||||||
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: '请输入目标地址(必填)',
|
message: "请输入目标地址(必填)",
|
||||||
trigger: 'blur',
|
trigger: "blur",
|
||||||
}],
|
},
|
||||||
equipType: [{
|
],
|
||||||
|
equipType: [
|
||||||
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: '请选择设备类型(必选)',
|
message: "请选择设备类型(必选)",
|
||||||
trigger: 'blur',
|
trigger: "blur",
|
||||||
}],
|
},
|
||||||
equipStatus: [{
|
],
|
||||||
|
equipStatus: [
|
||||||
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: '请选择设备状态(必选)',
|
message: "请选择设备状态(必选)",
|
||||||
trigger: 'blur',
|
trigger: "blur",
|
||||||
type: 'boolean'
|
type: "boolean",
|
||||||
}],
|
},
|
||||||
logicStatus: [{
|
],
|
||||||
|
logicStatus: [
|
||||||
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: '请选择逻辑状态(必选)',
|
message: "请选择逻辑状态(必选)",
|
||||||
trigger: 'blur',
|
trigger: "blur",
|
||||||
type: 'boolean'
|
type: "boolean",
|
||||||
}],
|
},
|
||||||
};
|
],
|
||||||
|
};
|
||||||
|
|
||||||
const editKey = "add";
|
const editKey = "add";
|
||||||
|
|
||||||
const submit = (e) => {
|
const submit = (e) => {
|
||||||
message.loading({
|
message.loading({
|
||||||
content: '提交中...',
|
content: "提交中...",
|
||||||
key: editKey
|
key: editKey,
|
||||||
});
|
});
|
||||||
formRef.value
|
formRef.value
|
||||||
.validate()
|
.validate()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
edit(toRaw(formState)).then((response) => {
|
edit(toRaw(formState)).then((response) => {
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
message.success({
|
message
|
||||||
content: '保存成功',
|
.success({
|
||||||
|
content: "保存成功",
|
||||||
key: editKey,
|
key: editKey,
|
||||||
duration: 1
|
duration: 1,
|
||||||
}).then(() => {
|
})
|
||||||
|
.then(() => {
|
||||||
cancel();
|
cancel();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
message.error({
|
message
|
||||||
|
.error({
|
||||||
content: response.msg,
|
content: response.msg,
|
||||||
key: editKey,
|
key: editKey,
|
||||||
duration: 1
|
duration: 1,
|
||||||
}).then(() => {
|
})
|
||||||
});
|
.then(() => {});
|
||||||
}
|
}
|
||||||
});
|
|
||||||
})
|
|
||||||
.catch(error => {
|
|
||||||
console.log('error', error);
|
|
||||||
});
|
});
|
||||||
};
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.log("error", error);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
const cancel = (e) => {
|
const cancel = (e) => {
|
||||||
formRef.value.resetFields();
|
formRef.value.resetFields();
|
||||||
context.emit("close", false);
|
context.emit("close", false);
|
||||||
};
|
};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
submit,
|
||||||
|
cancel,
|
||||||
|
formRef,
|
||||||
|
formState,
|
||||||
|
formRules,
|
||||||
|
|
||||||
submit,
|
equipTypes,
|
||||||
cancel,
|
taskTypes,
|
||||||
formRef,
|
directFlags,
|
||||||
formState,
|
equipStatusOptions,
|
||||||
formRules,
|
logicStatusOptions,
|
||||||
|
|
||||||
equipTypes,
|
labelCol: {
|
||||||
taskTypes,
|
span: 8,
|
||||||
directFlags,
|
},
|
||||||
equipStatusOptions,
|
wrapperCol: {
|
||||||
logicStatusOptions,
|
span: 12,
|
||||||
|
},
|
||||||
labelCol: {
|
};
|
||||||
span: 8
|
},
|
||||||
},
|
});
|
||||||
wrapperCol: {
|
|
||||||
span: 12
|
|
||||||
},
|
|
||||||
};
|
|
||||||
},
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -1,202 +1,286 @@
|
||||||
<template>
|
<template>
|
||||||
<a-modal :open="visible" title="新增区域出入口信息" cancelText="取消" okText="提交" @ok="submit" @cancel="cancel">
|
<a-modal
|
||||||
<a-form ref="formRef" :model="formState" :rules="formRules" :label-col="labelCol" :wrapper-col="wrapperCol">
|
:open="visible"
|
||||||
<a-form-item ref="equipCode" label="设备号" name="equipCode">
|
title="新增区域出入口信息"
|
||||||
<a-input v-model:value="formState.equipCode" placeholder="请输入设备号" />
|
cancelText="取消"
|
||||||
</a-form-item>
|
okText="提交"
|
||||||
<a-form-item ref="sourceLoc" label="起始地址" name="sourceLoc">
|
@ok="submit"
|
||||||
<a-input v-model:value="formState.sourceLoc" placeholder="请输入起始地址" />
|
@cancel="cancel"
|
||||||
</a-form-item>
|
>
|
||||||
<a-form-item ref="targetLoc" label="目标地址" name="targetLoc">
|
<a-form
|
||||||
<a-input v-model:value="formState.targetLoc" placeholder="请输入目标地址" />
|
ref="formRef"
|
||||||
</a-form-item>
|
:model="formState"
|
||||||
<a-form-item ref="equipType" label="设备类型" name="equipType">
|
:rules="formRules"
|
||||||
<a-select v-model:value="formState.equipType" :options="equipTypes" placeholder="请选择设备类型" />
|
layout="vertical"
|
||||||
</a-form-item>
|
>
|
||||||
<a-form-item ref="exitDesc" label="路径描述" name="exitDesc">
|
<a-row :gutter="[16, 0]">
|
||||||
<a-input v-model:value="formState.exitDesc" placeholder="请输入路径描述" />
|
<a-col :span="12">
|
||||||
</a-form-item>
|
<a-form-item ref="equipCode" label="设备号" name="equipCode">
|
||||||
<a-form-item ref="directFlag" label="方向标志" name="directFlag">
|
<a-input
|
||||||
<a-select v-model:value="formState.directFlag" :options="directFlags" placeholder="请选择方向标志" />
|
v-model:value="formState.equipCode"
|
||||||
</a-form-item>
|
placeholder="请输入设备号"
|
||||||
<a-form-item ref="taskLimit" label="任务数限制" name="taskLimit">
|
/>
|
||||||
<a-input-number v-model:value="formState.taskLimit" placeholder="请输入任务数限制" style="width: 100%;"/>
|
</a-form-item>
|
||||||
</a-form-item>
|
</a-col>
|
||||||
<a-form-item ref="equipStatus" label="设备状态" name="equipStatus">
|
<a-col :span="12">
|
||||||
<a-select v-model:value="formState.equipStatus" :options="equipStatusOptions" placeholder="请选择设备状态" />
|
<a-form-item ref="sourceLoc" label="起始地址" name="sourceLoc">
|
||||||
</a-form-item>
|
<a-input
|
||||||
<a-form-item ref="logicStatus" label="逻辑状态" name="logicStatus">
|
v-model:value="formState.sourceLoc"
|
||||||
<a-select v-model:value="formState.logicStatus" :options="logicStatusOptions" placeholder="请选择逻辑状态" />
|
placeholder="请输入起始地址"
|
||||||
</a-form-item>
|
/>
|
||||||
<a-form-item label="备注" name="remark">
|
</a-form-item>
|
||||||
<a-textarea v-model:value="formState.remark" />
|
</a-col>
|
||||||
</a-form-item>
|
<a-col :span="12">
|
||||||
|
<a-form-item ref="targetLoc" label="目标地址" name="targetLoc">
|
||||||
|
<a-input
|
||||||
|
v-model:value="formState.targetLoc"
|
||||||
|
placeholder="请输入目标地址"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item ref="equipType" label="设备类型" name="equipType">
|
||||||
|
<a-select
|
||||||
|
v-model:value="formState.equipType"
|
||||||
|
:options="equipTypes"
|
||||||
|
placeholder="请选择设备类型"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item ref="exitDesc" label="路径描述" name="exitDesc">
|
||||||
|
<a-input
|
||||||
|
v-model:value="formState.exitDesc"
|
||||||
|
placeholder="请输入路径描述"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item ref="directFlag" label="方向标志" name="directFlag">
|
||||||
|
<a-select
|
||||||
|
v-model:value="formState.directFlag"
|
||||||
|
:options="directFlags"
|
||||||
|
placeholder="请选择方向标志"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item ref="taskLimit" label="任务数限制" name="taskLimit">
|
||||||
|
<a-input-number
|
||||||
|
v-model:value="formState.taskLimit"
|
||||||
|
placeholder="请输入任务数限制"
|
||||||
|
style="width: 100%"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item ref="equipStatus" label="设备状态" name="equipStatus">
|
||||||
|
<a-select
|
||||||
|
v-model:value="formState.equipStatus"
|
||||||
|
:options="equipStatusOptions"
|
||||||
|
placeholder="请选择设备状态"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item ref="logicStatus" label="逻辑状态" name="logicStatus">
|
||||||
|
<a-select
|
||||||
|
v-model:value="formState.logicStatus"
|
||||||
|
:options="logicStatusOptions"
|
||||||
|
placeholder="请选择逻辑状态"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="备注" name="remark">
|
||||||
|
<a-textarea v-model:value="formState.remark" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
</a-form>
|
</a-form>
|
||||||
</a-modal>
|
</a-modal>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import {
|
import { message } from "@hwork/ant-design-vue";
|
||||||
message
|
import { save } from "@/api/wms/locExit";
|
||||||
} from '@hwork/ant-design-vue';
|
import { defineComponent, reactive, ref, toRaw } from "vue";
|
||||||
import {
|
export default defineComponent({
|
||||||
save
|
props: {
|
||||||
} from "@/api/wms/locExit";
|
visible: {
|
||||||
import {
|
type: Boolean,
|
||||||
defineComponent,
|
|
||||||
reactive,
|
|
||||||
ref,
|
|
||||||
toRaw
|
|
||||||
} from "vue";
|
|
||||||
export default defineComponent({
|
|
||||||
props: {
|
|
||||||
visible: {
|
|
||||||
type: Boolean,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
emit: ["close"],
|
},
|
||||||
setup(props, context) {
|
emit: ["close"],
|
||||||
|
setup(props, context) {
|
||||||
|
const formRef = ref();
|
||||||
|
|
||||||
const formRef = ref();
|
const state = reactive({});
|
||||||
|
|
||||||
const state = reactive({});
|
const formState = reactive({});
|
||||||
|
|
||||||
const formState = reactive({});
|
const equipTypes = ref([
|
||||||
|
{
|
||||||
|
value: "Stacker",
|
||||||
|
label: "堆垛机",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "Station",
|
||||||
|
label: "站台",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "Conveyer",
|
||||||
|
label: "小车",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "Agv",
|
||||||
|
label: "AGV",
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
|
||||||
const equipTypes = ref([{
|
const directFlags = ref([
|
||||||
value: 'Stacker',
|
{
|
||||||
label: '堆垛机',
|
value: "In",
|
||||||
}, {
|
label: "向里",
|
||||||
value: 'Station',
|
},
|
||||||
label: '站台',
|
{
|
||||||
}, {
|
value: "Out",
|
||||||
value: 'Conveyer',
|
label: "向外",
|
||||||
label: '小车',
|
},
|
||||||
}, {
|
{
|
||||||
value: 'Agv',
|
value: "Move",
|
||||||
label: 'AGV',
|
label: "移动",
|
||||||
}]);
|
},
|
||||||
|
]);
|
||||||
|
|
||||||
const directFlags = ref([{
|
const equipStatusOptions = ref([
|
||||||
value: 'In',
|
{
|
||||||
label: '向里',
|
value: "true",
|
||||||
}, {
|
label: "是",
|
||||||
value: 'Out',
|
},
|
||||||
label: '向外',
|
{
|
||||||
}, {
|
value: "false",
|
||||||
value: 'Move',
|
label: "否",
|
||||||
label: '移动',
|
},
|
||||||
}]);
|
]);
|
||||||
|
|
||||||
const equipStatusOptions = ref([{
|
const logicStatusOptions = ref([
|
||||||
value: 'true',
|
{
|
||||||
label: '是',
|
value: "true",
|
||||||
}, {
|
label: "是",
|
||||||
value: 'false',
|
},
|
||||||
label: '否',
|
{
|
||||||
}]);
|
value: "false",
|
||||||
|
label: "否",
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
|
||||||
const logicStatusOptions = ref([{
|
const formRules = {
|
||||||
value: 'true',
|
equipCode: [
|
||||||
label: '是',
|
{
|
||||||
}, {
|
|
||||||
value: 'false',
|
|
||||||
label: '否',
|
|
||||||
}]);
|
|
||||||
|
|
||||||
const formRules = {
|
|
||||||
equipCode: [{
|
|
||||||
required: true,
|
required: true,
|
||||||
message: '请输入设备号(必填)',
|
message: "请输入设备号(必填)",
|
||||||
trigger: 'blur'
|
trigger: "blur",
|
||||||
}],
|
},
|
||||||
sourceLoc: [{
|
],
|
||||||
|
sourceLoc: [
|
||||||
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: '请输入起始地址(必填)',
|
message: "请输入起始地址(必填)",
|
||||||
trigger: 'blur'
|
trigger: "blur",
|
||||||
}],
|
},
|
||||||
targetLoc: [{
|
],
|
||||||
|
targetLoc: [
|
||||||
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: '请输入目标地址(必填)',
|
message: "请输入目标地址(必填)",
|
||||||
trigger: 'blur',
|
trigger: "blur",
|
||||||
}],
|
},
|
||||||
equipType: [{
|
],
|
||||||
|
equipType: [
|
||||||
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: '请选择设备类型(必选)',
|
message: "请选择设备类型(必选)",
|
||||||
trigger: 'blur',
|
trigger: "blur",
|
||||||
}],
|
},
|
||||||
equipStatus: [{
|
],
|
||||||
|
equipStatus: [
|
||||||
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: '请选择设备状态(必选)',
|
message: "请选择设备状态(必选)",
|
||||||
trigger: 'blur',
|
trigger: "blur",
|
||||||
}],
|
},
|
||||||
logicStatus: [{
|
],
|
||||||
|
logicStatus: [
|
||||||
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: '请选择逻辑状态(必选)',
|
message: "请选择逻辑状态(必选)",
|
||||||
trigger: 'blur',
|
trigger: "blur",
|
||||||
}],
|
},
|
||||||
};
|
],
|
||||||
|
};
|
||||||
|
|
||||||
const saveKey = "save";
|
const saveKey = "save";
|
||||||
|
|
||||||
|
const submit = (e) => {
|
||||||
const submit = (e) => {
|
message.loading({
|
||||||
message.loading({
|
content: "提交中...",
|
||||||
content: '提交中...',
|
key: saveKey,
|
||||||
key: saveKey
|
});
|
||||||
});
|
formRef.value
|
||||||
formRef.value
|
.validate()
|
||||||
.validate()
|
.then(() => {
|
||||||
.then(() => {
|
save(toRaw(formState)).then((response) => {
|
||||||
save(toRaw(formState)).then((response) => {
|
if (response.success) {
|
||||||
if (response.success) {
|
message
|
||||||
message.success({
|
.success({
|
||||||
content: '保存成功',
|
content: "保存成功",
|
||||||
key: saveKey,
|
key: saveKey,
|
||||||
duration: 1
|
duration: 1,
|
||||||
}).then(() => {
|
})
|
||||||
|
.then(() => {
|
||||||
cancel();
|
cancel();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
message.error({
|
message
|
||||||
|
.error({
|
||||||
content: response.msg,
|
content: response.msg,
|
||||||
key: saveKey,
|
key: saveKey,
|
||||||
duration: 1
|
duration: 1,
|
||||||
}).then(() => {
|
})
|
||||||
});
|
.then(() => {});
|
||||||
}
|
}
|
||||||
});
|
|
||||||
})
|
|
||||||
.catch(error => {
|
|
||||||
console.log('error', error);
|
|
||||||
});
|
});
|
||||||
};
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.log("error", error);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
const cancel = (e) => {
|
const cancel = (e) => {
|
||||||
formRef.value.resetFields();
|
formRef.value.resetFields();
|
||||||
context.emit("close", false);
|
context.emit("close", false);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
return {
|
||||||
|
state,
|
||||||
|
submit,
|
||||||
|
cancel,
|
||||||
|
formRef,
|
||||||
|
formState,
|
||||||
|
formRules,
|
||||||
|
|
||||||
return {
|
equipTypes,
|
||||||
state,
|
directFlags,
|
||||||
submit,
|
equipStatusOptions,
|
||||||
cancel,
|
logicStatusOptions,
|
||||||
formRef,
|
|
||||||
formState,
|
|
||||||
formRules,
|
|
||||||
|
|
||||||
equipTypes,
|
labelCol: {
|
||||||
directFlags,
|
span: 8,
|
||||||
equipStatusOptions,
|
},
|
||||||
logicStatusOptions,
|
wrapperCol: {
|
||||||
|
span: 12,
|
||||||
labelCol: {
|
},
|
||||||
span: 8
|
};
|
||||||
},
|
},
|
||||||
wrapperCol: {
|
});
|
||||||
span: 12
|
|
||||||
},
|
|
||||||
};
|
|
||||||
},
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue