emis-frontend/src/views/emis/emisTmsSiteBatchMiss/emisTmsSiteBatchMissForm.vue
2025-06-09 17:29:50 +08:00

128 lines
3.3 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<div >
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-row :gutter="0" style="display: flex;flex-wrap: wrap;">
<el-col :span="24">
<el-form-item label="运单号" prop="billCode">
<el-input v-model="form.billCode" placeholder="请输入运单号" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="漏组批次原因" prop="missReason">
<el-input v-model="form.missReason" placeholder="请输入漏组批次原因" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div style="text-align: center;margin-bottom: 10px;">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</div>
</template>
<script>
import { listEmisTmsSiteBatchMiss, getEmisTmsSiteBatchMiss, delEmisTmsSiteBatchMiss, addEmisTmsSiteBatchMiss, updateEmisTmsSiteBatchMiss } from "@/api/emis/emisTmsSiteBatchMiss";
export default {
name: "emisTmsSiteBatchMissForm",
props:{
id:{
type:Number
}
},
components: { },
dicts: [
],
data() {
return {
emisTmsSiteBatchMissOptions: [],
// 遮罩层
loading: true,
// 表单参数
form: {},
// 表单校验
rules: {
id: [
{ required: true, message: "主键ID不能为空", trigger: "blur" }
],
billCode: [
{ required: true, message: "运单号不能为空", trigger: "blur" }
],
delFlag: [
{ required: true, message: "删除标志(0代表存在不能为空", trigger: "blur" }
]
}
};
},
watch: {
"id": {
handler (newValue, oldValue) {
this.id = newValue;
this.initData();
},
deep: true
}
},
created() {
this.initData();
},
methods: {
initData() {
if(this.id !=null) {
this.loading = true;
getEmisTmsSiteBatchMiss(this.id).then(response => {
this.form = response.data;
this.loading = false;
});
}else{
this.reset();
}
// this.getTreeselect();
},
// 取消按钮
cancel() {
this.reset();
this.$emit("on-cancel");
},
// 表单重置
reset() {
this.form = {
id: null,
transPlanRuleId: null,
billCode: null,
missReason: null,
remark: null,
};
this.resetForm("form");
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateEmisTmsSiteBatchMiss(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.$emit("on-changed");
});
} else {
addEmisTmsSiteBatchMiss(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.$emit("on-changed");
});
}
}
});
},
}
};
</script>