This commit is contained in:
linfso 2024-06-20 12:48:19 +08:00
parent f83a7405a2
commit 2bb26f0b9d

View File

@ -0,0 +1,184 @@
<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="title">
<el-input v-model="form.title" placeholder="请输入标题" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="具体内容" prop="content">
<el-input v-model="form.content" placeholder="请输入具体内容" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="状态" prop="status">
<el-input v-model="form.status" placeholder="请输入状态" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="是否显示" prop="showFlag">
<el-input v-model="form.showFlag" 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 { listEmisWaybillProblemFaq, getEmisWaybillProblemFaq, delEmisWaybillProblemFaq, addEmisWaybillProblemFaq, updateEmisWaybillProblemFaq } from "@/api/emis/emisWaybillProblemFaq";
export default {
name: "emisWaybillProblemFaqForm",
props:{
id:{
type:Number
}
},
components: { },
dicts: [
],
data() {
return {
emisWaybillProblemFaqOptions: [],
// 遮罩层
loading: true,
// 表单参数
form: {},
// 表单校验
rules: {
id: [
{ required: true, message: "id不能为空", trigger: "blur" }
],
probId: [
{ required: true, message: "问题件序号不能为空", trigger: "blur" }
],
title: [
{ required: true, message: "标题不能为空", trigger: "blur" }
],
content: [
{ required: true, message: "具体内容不能为空", 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;
getEmisWaybillProblemFaq(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,
probId: null,
billCode: null,
title: null,
content: null,
status: null,
showFlag: null,
replayId: null,
delFlag: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null,
createSite: null,
updateSite: null
};
this.resetForm("form");
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateEmisWaybillProblemFaq(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.$emit("on-changed");
});
} else {
addEmisWaybillProblemFaq(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.$emit("on-changed");
});
}
}
});
},
// /** 转换菜单数据结构 */
// normalizer(node) {
// if (node.children && !node.children.length) {
// delete node.children;
// }
// return {
// id: node.id,
// label: node.idName,
// children: node.children
// };
// },
// /** 查询菜单下拉树结构 */
// getTreeselect() {
// const queryParams = {}
// listEmisWaybillProblemFaq(queryParams).then(response => {
// this.emisWaybillProblemFaqOptions = [];
// const rootItem = { idId: 0, emisWaybillProblemFaqName: '-', children: [] };
// rootItem.children = this.handleTree(response.data, "id");
// this.emisWaybillProblemFaqOptions.push(rootItem);
// if(this.parentId != undefined) {
// this.form.parentId = this.parentId;
// }
// });
// },
}
};
</script>