hgwms-2098 fix 搬运类型弹窗修改
parent
0e204f5cee
commit
087b9aa7b3
|
|
@ -1,103 +1,156 @@
|
|||
<template>
|
||||
<a-modal :open="visible" title="编辑搬运类型" cancelText="取消" okText="提交" @ok="submit" @cancel="cancel">
|
||||
<a-form ref="formRef" :model="formState" :rules="formRules" :label-col="labelCol" :wrapper-col="wrapperCol" :popupScroll = "popupScroll">
|
||||
|
||||
<a-modal
|
||||
:open="visible"
|
||||
title="编辑搬运类型"
|
||||
cancelText="取消"
|
||||
okText="提交"
|
||||
@ok="submit"
|
||||
@cancel="cancel"
|
||||
>
|
||||
<a-form
|
||||
ref="formRef"
|
||||
:model="formState"
|
||||
:rules="formRules"
|
||||
layout="vertical"
|
||||
:popupScroll="popupScroll"
|
||||
>
|
||||
<!-- <a-form-item ref="deliverDesc" label="搬运类型描述" name="deliverDesc">
|
||||
<a-input v-model:value="formState.deliverDesc" placeholder="请输入搬运类型描述" />
|
||||
</a-form-item> -->
|
||||
<a-form-item ref="deliver" label="搬运类型" name="deliver">
|
||||
<a-input v-model:value="formState.deliver" placeholder="请输入搬运类型" />
|
||||
</a-form-item>
|
||||
<a-row :gutter="[16, 0]">
|
||||
<a-col :span="12">
|
||||
<a-form-item ref="deliver" label="搬运类型" name="deliver">
|
||||
<a-input
|
||||
v-model:value="formState.deliver"
|
||||
placeholder="请输入搬运类型"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="产生任务标志">
|
||||
<a-select
|
||||
v-model:value="formState.jobFlag"
|
||||
placeholder="请选择产生任务标志"
|
||||
:options="jobFlag"
|
||||
>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item ref="sourceLoc" label="源位置" name="sourceLoc">
|
||||
<a-input
|
||||
v-model:value="formState.sourceLoc"
|
||||
placeholder="请输入源位置"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="源策略">
|
||||
<a-select
|
||||
v-model:value="formState.sourceStactics"
|
||||
:options="deliverSourceStactics"
|
||||
mode="tags"
|
||||
:size="size"
|
||||
placeholder="请选择源策略"
|
||||
autoClearSearchValue="ture"
|
||||
>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<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="targetStactics"
|
||||
label="目标策略"
|
||||
name="targetStactics"
|
||||
>
|
||||
<a-input
|
||||
v-model:value="formState.targetStactics"
|
||||
placeholder="请输入目标策略"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item ref="pltFlag" label="删除托盘标记" name="pltFlag">
|
||||
<a-input
|
||||
v-model:value="formState.pltFlag"
|
||||
placeholder="请输入删除托盘标记"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="优先级">
|
||||
<a-select
|
||||
v-model:value="formState.priority"
|
||||
placeholder="请选择优先级"
|
||||
:options="priority"
|
||||
>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="方向标志">
|
||||
<a-select
|
||||
v-model:value="formState.directFlag"
|
||||
placeholder="请选择方向标志"
|
||||
:options="directFlag"
|
||||
>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<a-form-item label="产生任务标志">
|
||||
<a-select v-model:value="formState.jobFlag" placeholder="请选择产生任务标志" :options="jobFlag">
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item ref="sourceLoc" label="源位置" name="sourceLoc">
|
||||
<a-input v-model:value="formState.sourceLoc" placeholder="请输入源位置" />
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="源策略">
|
||||
<a-select v-model:value="formState.sourceStactics" :options="deliverSourceStactics" mode="tags" :size="size" placeholder="请选择源策略"
|
||||
style="width: 200px" autoClearSearchValue = "ture" >
|
||||
</a-select>
|
||||
|
||||
</a-form-item>
|
||||
<!-- <a-form-item ref="sourceStactics" label="源策略" name="sourceStactics">
|
||||
<!-- <a-form-item ref="sourceStactics" label="源策略" name="sourceStactics">
|
||||
<a-radio-group v-model:value="formState.sourceStactics" placeholder="请输入源策略" />
|
||||
</a-form-item> -->
|
||||
<a-form-item ref="targetLoc" label="目标位置" name="targetLoc">
|
||||
<a-input v-model:value="formState.targetLoc" placeholder="请输入目标位置" />
|
||||
</a-form-item>
|
||||
<a-form-item ref="targetStactics" label="目标策略" name="targetStactics">
|
||||
<a-input v-model:value="formState.targetStactics" placeholder="请输入目标策略" />
|
||||
</a-form-item>
|
||||
<a-form-item ref="pltFlag" label="删除托盘标记" name="pltFlag">
|
||||
<a-input v-model:value="formState.pltFlag" placeholder="请输入删除托盘标记" />
|
||||
</a-form-item>
|
||||
<a-form-item label="优先级">
|
||||
<a-select v-model:value="formState.priority" placeholder="请选择优先级" :options="priority">
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-form-item label="方向标志">
|
||||
<a-select v-model:value="formState.directFlag" placeholder="请选择方向标志" :options="directFlag">
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-modal>
|
||||
</template>
|
||||
<script>
|
||||
import { message } from "@hwork/ant-design-vue";
|
||||
import { edit } from "@/api/wms/deliverType";
|
||||
import { defineComponent, reactive, ref, toRaw, watch } from "vue";
|
||||
|
||||
import {
|
||||
message
|
||||
} from '@hwork/ant-design-vue';
|
||||
import {
|
||||
edit
|
||||
} from "@/api/wms/deliverType";
|
||||
import {
|
||||
defineComponent,
|
||||
reactive,
|
||||
ref,
|
||||
toRaw,
|
||||
watch
|
||||
} from "vue";
|
||||
|
||||
|
||||
export default defineComponent({
|
||||
props: {
|
||||
visible: {
|
||||
type: Boolean,
|
||||
},
|
||||
record: {
|
||||
type: Object,
|
||||
}
|
||||
export default defineComponent({
|
||||
props: {
|
||||
visible: {
|
||||
type: Boolean,
|
||||
},
|
||||
emit: ["close"],
|
||||
setup(props, context) {
|
||||
record: {
|
||||
type: Object,
|
||||
},
|
||||
},
|
||||
emit: ["close"],
|
||||
setup(props, context) {
|
||||
const formRef = ref();
|
||||
|
||||
const formRef = ref();
|
||||
const formState = reactive({});
|
||||
|
||||
const formState = reactive({});
|
||||
watch(props, (props) => {
|
||||
formState.id = props.record.id;
|
||||
formState.deliver = props.record.deliver;
|
||||
formState.priority = props.record.priority;
|
||||
formState.directFlag = props.record.directFlag;
|
||||
formState.deliverDesc = props.record.deliverDesc;
|
||||
formState.jobFlag = props.record.jobFlag;
|
||||
formState.sourceLoc = props.record.sourceLoc;
|
||||
formState.sourceStactics = props.record.sourceStactics;
|
||||
formState.targetLoc = props.record.targetLoc;
|
||||
formState.targetStactics = props.record.targetStactics;
|
||||
formState.pltFlag = props.record.pltFlag;
|
||||
formState.sourceLoc = props.record.sourceLoc;
|
||||
// formState.beginDate = props.record.beginDate;
|
||||
// formState.finishDate = props.record.finishDate;
|
||||
});
|
||||
|
||||
watch(props, (props) => {
|
||||
formState.id = props.record.id;
|
||||
formState.deliver = props.record.deliver;
|
||||
formState.priority = props.record.priority;
|
||||
formState.directFlag = props.record.directFlag;
|
||||
formState.deliverDesc = props.record.deliverDesc;
|
||||
formState.jobFlag = props.record.jobFlag;
|
||||
formState.sourceLoc = props.record.sourceLoc;
|
||||
formState.sourceStactics = props.record.sourceStactics;
|
||||
formState.targetLoc = props.record.targetLoc;
|
||||
formState.targetStactics = props.record.targetStactics;
|
||||
formState.pltFlag = props.record.pltFlag;
|
||||
formState.sourceLoc = props.record.sourceLoc;
|
||||
// formState.beginDate = props.record.beginDate;
|
||||
// formState.finishDate = props.record.finishDate;
|
||||
})
|
||||
|
||||
/* const delivers = ref([{
|
||||
/* const delivers = ref([{
|
||||
value: '人工',
|
||||
label: '人工',
|
||||
}, {
|
||||
|
|
@ -106,161 +159,187 @@
|
|||
},
|
||||
]); */
|
||||
|
||||
const deliverSourceStactics = ref([{
|
||||
value: '散盘优先',
|
||||
label: '散盘优先',
|
||||
}, {
|
||||
value: '先进先出',
|
||||
label: '先进先出',
|
||||
const deliverSourceStactics = ref([
|
||||
{
|
||||
value: "散盘优先",
|
||||
label: "散盘优先",
|
||||
},
|
||||
{
|
||||
value: '3',
|
||||
label: '先进后出',
|
||||
value: "先进先出",
|
||||
label: "先进先出",
|
||||
},
|
||||
{
|
||||
value: '4',
|
||||
label: '后进后出',
|
||||
value: "3",
|
||||
label: "先进后出",
|
||||
},
|
||||
{
|
||||
value: '5',
|
||||
label: '后进先出',
|
||||
value: "4",
|
||||
label: "后进后出",
|
||||
},
|
||||
{
|
||||
value: '6',
|
||||
label: '整盘优先',
|
||||
value: "5",
|
||||
label: "后进先出",
|
||||
},
|
||||
{
|
||||
value: '7',
|
||||
label: '批次出库',
|
||||
value: "6",
|
||||
label: "整盘优先",
|
||||
},
|
||||
]);
|
||||
{
|
||||
value: "7",
|
||||
label: "批次出库",
|
||||
},
|
||||
]);
|
||||
|
||||
const directFlag = ref([{
|
||||
value: 'In',
|
||||
label: '入库',
|
||||
}, {
|
||||
value: 'Out',
|
||||
label: '出库',
|
||||
}, {
|
||||
value: 'Move',
|
||||
label: '移库',
|
||||
}]);
|
||||
const directFlag = ref([
|
||||
{
|
||||
value: "In",
|
||||
label: "入库",
|
||||
},
|
||||
{
|
||||
value: "Out",
|
||||
label: "出库",
|
||||
},
|
||||
{
|
||||
value: "Move",
|
||||
label: "移库",
|
||||
},
|
||||
]);
|
||||
|
||||
const priority = ref([{
|
||||
value: '1',
|
||||
label: '正常',
|
||||
}, {
|
||||
value: '0',
|
||||
label: '低',
|
||||
}, {
|
||||
value: '2',
|
||||
label: '高',
|
||||
}]);
|
||||
const priority = ref([
|
||||
{
|
||||
value: "1",
|
||||
label: "正常",
|
||||
},
|
||||
{
|
||||
value: "0",
|
||||
label: "低",
|
||||
},
|
||||
{
|
||||
value: "2",
|
||||
label: "高",
|
||||
},
|
||||
]);
|
||||
|
||||
const jobFlag = ref([{
|
||||
value: '1',
|
||||
label: '是',
|
||||
}, {
|
||||
value: '0',
|
||||
label: '否',
|
||||
}]);
|
||||
const jobFlag = ref([
|
||||
{
|
||||
value: "1",
|
||||
label: "是",
|
||||
},
|
||||
{
|
||||
value: "0",
|
||||
label: "否",
|
||||
},
|
||||
]);
|
||||
|
||||
const formRules = {
|
||||
deliver: [{
|
||||
required: true,
|
||||
message: '请输入搬运类型(必填)',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
priority: [{
|
||||
required: true,
|
||||
message: '请选择优先级(必填)',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
sourceStactics: [{
|
||||
required: true,
|
||||
message: '请输入源策略(必填)',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
targetStactics: [{
|
||||
required: true,
|
||||
message: '请输入目标策略(必选)',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
directFlag: [{
|
||||
required: true,
|
||||
message: '请选择方向标志(必选)',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
const formRules = {
|
||||
deliver: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入搬运类型(必填)",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
priority: [
|
||||
{
|
||||
required: true,
|
||||
message: "请选择优先级(必填)",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
sourceStactics: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入源策略(必填)",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
targetStactics: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入目标策略(必选)",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
directFlag: [
|
||||
{
|
||||
required: true,
|
||||
message: "请选择方向标志(必选)",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const editKey = "add";
|
||||
const editKey = "add";
|
||||
|
||||
const submit = (e) => {
|
||||
console.log("formRef.value",formRef.value)
|
||||
console.log("formState",formState)
|
||||
console.log("formState sourceStactics",formState.sourceStactics)
|
||||
var a =JSON.stringify(formState.sourceStactics);
|
||||
formState.sourceStactics = JSON.stringify(formState.sourceStactics);
|
||||
console.log("formState sourceStactics",a);
|
||||
message.loading({
|
||||
content: '提交中...',
|
||||
key: editKey
|
||||
});
|
||||
formRef.value
|
||||
.validate()
|
||||
.then(() => {
|
||||
edit(toRaw(formState)).then((response) => {
|
||||
if (response.success) {
|
||||
message.success({
|
||||
content: '保存成功',
|
||||
const submit = (e) => {
|
||||
console.log("formRef.value", formRef.value);
|
||||
console.log("formState", formState);
|
||||
console.log("formState sourceStactics", formState.sourceStactics);
|
||||
var a = JSON.stringify(formState.sourceStactics);
|
||||
formState.sourceStactics = JSON.stringify(formState.sourceStactics);
|
||||
console.log("formState sourceStactics", a);
|
||||
message.loading({
|
||||
content: "提交中...",
|
||||
key: editKey,
|
||||
});
|
||||
formRef.value
|
||||
.validate()
|
||||
.then(() => {
|
||||
edit(toRaw(formState)).then((response) => {
|
||||
if (response.success) {
|
||||
message
|
||||
.success({
|
||||
content: "保存成功",
|
||||
key: editKey,
|
||||
duration: 1
|
||||
}).then(() => {
|
||||
duration: 1,
|
||||
})
|
||||
.then(() => {
|
||||
cancel();
|
||||
});
|
||||
} else {
|
||||
message.error({
|
||||
} else {
|
||||
message
|
||||
.error({
|
||||
content: response.msg,
|
||||
key: editKey,
|
||||
duration: 1
|
||||
}).then(() => {
|
||||
duration: 1,
|
||||
})
|
||||
.then(() => {
|
||||
// cancel();
|
||||
});
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch(error => {
|
||||
console.log('error', error);
|
||||
}
|
||||
});
|
||||
};
|
||||
const popupScroll = () => {
|
||||
console.log('popupScroll');
|
||||
};
|
||||
const cancel = (e) => {
|
||||
formRef.value.resetFields();
|
||||
context.emit("close", false);
|
||||
};
|
||||
return {
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log("error", error);
|
||||
});
|
||||
};
|
||||
const popupScroll = () => {
|
||||
console.log("popupScroll");
|
||||
};
|
||||
const cancel = (e) => {
|
||||
formRef.value.resetFields();
|
||||
context.emit("close", false);
|
||||
};
|
||||
return {
|
||||
submit,
|
||||
cancel,
|
||||
formRef,
|
||||
formState,
|
||||
|
||||
submit,
|
||||
cancel,
|
||||
formRef,
|
||||
formState,
|
||||
directFlag,
|
||||
formRules,
|
||||
priority,
|
||||
jobFlag,
|
||||
deliverSourceStactics,
|
||||
popupScroll,
|
||||
|
||||
directFlag,
|
||||
formRules,
|
||||
priority,
|
||||
jobFlag,
|
||||
deliverSourceStactics,
|
||||
popupScroll,
|
||||
|
||||
labelCol: {
|
||||
span: 8
|
||||
},
|
||||
wrapperCol: {
|
||||
span: 12
|
||||
},
|
||||
};
|
||||
},
|
||||
});
|
||||
labelCol: {
|
||||
span: 8,
|
||||
},
|
||||
wrapperCol: {
|
||||
span: 12,
|
||||
},
|
||||
};
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -1,48 +1,107 @@
|
|||
<template>
|
||||
<a-modal :open="visible" title="新增搬运类型" cancelText="取消" okText="提交" @ok="submit" @cancel="cancel">
|
||||
<a-form ref="formRef" :model="formState" :rules="formRules" :label-col="labelCol" :wrapper-col="wrapperCol">
|
||||
<a-form-item ref="deliver" label="搬运类型" name="deliver">
|
||||
<a-input v-model:value="formState.deliver" placeholder="请输入搬运类型描述" />
|
||||
</a-form-item>
|
||||
<a-form-item ref="deliverDesc" label="搬运类型描述" name="deliverDesc">
|
||||
<a-input v-model:value="formState.deliverDesc" placeholder="请输入搬运类型描述" />
|
||||
</a-form-item>
|
||||
<a-form-item ref="sourceStactics" label="源策略" name="sourceStactics">
|
||||
<a-input v-model:value="formState.sourceStactics" placeholder="请输入源策略" />
|
||||
</a-form-item>
|
||||
<a-form-item ref="targetStactics" label="目标策略" name="targetStactics">
|
||||
<a-input v-model:value="formState.targetStactics" placeholder="请输入目标策略" />
|
||||
</a-form-item>
|
||||
<a-form-item ref="sourceLoc" label="源位置" name="sourceLoc">
|
||||
<a-input v-model:value="formState.sourceLoc" placeholder="请输入源位置" />
|
||||
</a-form-item>
|
||||
<a-form-item ref="targetLoc" label="目标位置" name="targetLoc">
|
||||
<a-input v-model:value="formState.targetLoc" placeholder="请输入目标位置" />
|
||||
</a-form-item>
|
||||
<a-form-item label="方向标志">
|
||||
<a-select v-model:value="formState.directFlag" placeholder="请选择方向标志" :options="directFlag">
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-form-item label="优先级">
|
||||
<a-select v-model:value="formState.priority" placeholder="请选择优先级" :options="priority">
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-modal
|
||||
:open="visible"
|
||||
title="新增搬运类型"
|
||||
cancelText="取消"
|
||||
okText="提交"
|
||||
@ok="submit"
|
||||
@cancel="cancel"
|
||||
>
|
||||
<a-form
|
||||
ref="formRef"
|
||||
:model="formState"
|
||||
:rules="formRules"
|
||||
layout="vertical"
|
||||
>
|
||||
<a-row :gutter="[16, 0]">
|
||||
<a-col :span="12">
|
||||
<a-form-item ref="deliver" label="搬运类型" name="deliver">
|
||||
<a-input
|
||||
v-model:value="formState.deliver"
|
||||
placeholder="请输入搬运类型描述"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item
|
||||
ref="deliverDesc"
|
||||
label="搬运类型描述"
|
||||
name="deliverDesc"
|
||||
>
|
||||
<a-input
|
||||
v-model:value="formState.deliverDesc"
|
||||
placeholder="请输入搬运类型描述"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item
|
||||
ref="sourceStactics"
|
||||
label="源策略"
|
||||
name="sourceStactics"
|
||||
>
|
||||
<a-input
|
||||
v-model:value="formState.sourceStactics"
|
||||
placeholder="请输入源策略"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item
|
||||
ref="targetStactics"
|
||||
label="目标策略"
|
||||
name="targetStactics"
|
||||
>
|
||||
<a-input
|
||||
v-model:value="formState.targetStactics"
|
||||
placeholder="请输入目标策略"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item ref="sourceLoc" label="源位置" name="sourceLoc">
|
||||
<a-input
|
||||
v-model:value="formState.sourceLoc"
|
||||
placeholder="请输入源位置"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<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 label="方向标志">
|
||||
<a-select
|
||||
v-model:value="formState.directFlag"
|
||||
placeholder="请选择方向标志"
|
||||
:options="directFlag"
|
||||
>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="优先级">
|
||||
<a-select
|
||||
v-model:value="formState.priority"
|
||||
placeholder="请选择优先级"
|
||||
:options="priority"
|
||||
>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</a-modal>
|
||||
</template>
|
||||
<script>
|
||||
import {
|
||||
message
|
||||
} from '@hwork/ant-design-vue';
|
||||
import {
|
||||
save
|
||||
} from "@/api/wms/deliverType";
|
||||
import {
|
||||
defineComponent,
|
||||
reactive,
|
||||
ref,
|
||||
toRaw
|
||||
} from "vue";
|
||||
import { message } from "@hwork/ant-design-vue";
|
||||
import { save } from "@/api/wms/deliverType";
|
||||
import { defineComponent, reactive, ref, toRaw } from "vue";
|
||||
export default defineComponent({
|
||||
props: {
|
||||
visible: {
|
||||
|
|
@ -51,7 +110,6 @@ export default defineComponent({
|
|||
},
|
||||
emit: ["close"],
|
||||
setup(props, context) {
|
||||
|
||||
const formRef = ref();
|
||||
|
||||
const state = reactive({});
|
||||
|
|
@ -66,89 +124,110 @@ export default defineComponent({
|
|||
label: '机械手',
|
||||
}]); */
|
||||
|
||||
const directFlag = ref([{
|
||||
value: 'In',
|
||||
label: '入库',
|
||||
}, {
|
||||
value: 'Out',
|
||||
label: '出库',
|
||||
}, {
|
||||
value: 'Move',
|
||||
label: '移库',
|
||||
}]);
|
||||
const directFlag = ref([
|
||||
{
|
||||
value: "In",
|
||||
label: "入库",
|
||||
},
|
||||
{
|
||||
value: "Out",
|
||||
label: "出库",
|
||||
},
|
||||
{
|
||||
value: "Move",
|
||||
label: "移库",
|
||||
},
|
||||
]);
|
||||
|
||||
const priority = ref([{
|
||||
value: '1',
|
||||
label: '正常',
|
||||
}, {
|
||||
value: '0',
|
||||
label: '低',
|
||||
}, {
|
||||
value: '2',
|
||||
label: '高',
|
||||
}]);
|
||||
const priority = ref([
|
||||
{
|
||||
value: "1",
|
||||
label: "正常",
|
||||
},
|
||||
{
|
||||
value: "0",
|
||||
label: "低",
|
||||
},
|
||||
{
|
||||
value: "2",
|
||||
label: "高",
|
||||
},
|
||||
]);
|
||||
|
||||
const formRules = {
|
||||
deliver: [{
|
||||
required: true,
|
||||
message: '请输入搬运类型(必填)',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
priority: [{
|
||||
required: true,
|
||||
message: '请选择优先级(必填)',
|
||||
trigger: 'change'
|
||||
}],
|
||||
sourceLoc: [{
|
||||
required: true,
|
||||
message: '请输入原位置(必填)',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
targetLoc: [{
|
||||
required: true,
|
||||
message: '请输入目标位置(必选)',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
directFlag: [{
|
||||
required: true,
|
||||
message: '请选择方向标志(必选)',
|
||||
trigger: 'change'
|
||||
}],
|
||||
deliver: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入搬运类型(必填)",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
priority: [
|
||||
{
|
||||
required: true,
|
||||
message: "请选择优先级(必填)",
|
||||
trigger: "change",
|
||||
},
|
||||
],
|
||||
sourceLoc: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入原位置(必填)",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
targetLoc: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入目标位置(必选)",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
directFlag: [
|
||||
{
|
||||
required: true,
|
||||
message: "请选择方向标志(必选)",
|
||||
trigger: "change",
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const saveKey = "save";
|
||||
|
||||
|
||||
const submit = (e) => {
|
||||
message.loading({
|
||||
content: '提交中...',
|
||||
key: saveKey
|
||||
content: "提交中...",
|
||||
key: saveKey,
|
||||
});
|
||||
formRef.value
|
||||
.validate()
|
||||
.then(() => {
|
||||
save(toRaw(formState)).then((response) => {
|
||||
if (response.success) {
|
||||
message.success({
|
||||
content: '保存成功',
|
||||
key: saveKey,
|
||||
duration: 1
|
||||
}).then(() => {
|
||||
cancel();
|
||||
});
|
||||
message
|
||||
.success({
|
||||
content: "保存成功",
|
||||
key: saveKey,
|
||||
duration: 1,
|
||||
})
|
||||
.then(() => {
|
||||
cancel();
|
||||
});
|
||||
} else {
|
||||
message.error({
|
||||
content: response.msg,
|
||||
key: saveKey,
|
||||
duration: 1
|
||||
}).then(() => {
|
||||
// cancel();
|
||||
});
|
||||
message
|
||||
.error({
|
||||
content: response.msg,
|
||||
key: saveKey,
|
||||
duration: 1,
|
||||
})
|
||||
.then(() => {
|
||||
// cancel();
|
||||
});
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch(error => {
|
||||
console.log('error', error);
|
||||
.catch((error) => {
|
||||
console.log("error", error);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -157,7 +236,6 @@ export default defineComponent({
|
|||
context.emit("close", false);
|
||||
};
|
||||
|
||||
|
||||
return {
|
||||
state,
|
||||
submit,
|
||||
|
|
@ -169,10 +247,10 @@ export default defineComponent({
|
|||
priority,
|
||||
|
||||
labelCol: {
|
||||
span: 8
|
||||
span: 8,
|
||||
},
|
||||
wrapperCol: {
|
||||
span: 12
|
||||
span: 12,
|
||||
},
|
||||
};
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue