emis-frontend/src/views/emis/emisWaybillProblemFaq/commentInfoForm.vue

201 lines
5.8 KiB
Vue
Raw Normal View History

2024-06-20 04:48:19 +00:00
<template>
<div >
2024-06-20 05:36:41 +00:00
<el-form ref="form" :model="form" size="mini" :rules="rules" label-width="80px">
2024-06-20 04:48:19 +00:00
<el-row :gutter="0" style="display: flex;flex-wrap: wrap;">
<el-col :span="24">
2024-06-20 05:36:41 +00:00
<el-form-item label="处理状态" prop="status">
2024-06-24 05:40:52 +00:00
<!-- <el-input v-model="form.status" placeholder="" /> -->
<el-select v-model="form.status" :placeholder="$t('全部')">
<el-option :label="$t('未处理')" value="0"></el-option>
<el-option :label="$t('处理中')" value="1"></el-option>
<el-option :label="$t('处理完毕')" value="2"></el-option>
</el-select>
2024-06-20 04:48:19 +00:00
</el-form-item>
</el-col>
<el-col :span="24">
2024-06-20 05:36:41 +00:00
<el-form-item label="回复内容" prop="content">
<el-input v-model="form.content" type="textarea" placeholder="请输入具体内容" />
2024-06-20 04:48:19 +00:00
</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>
2024-06-20 09:31:46 +00:00
<el-scrollbar class="kr-designer-tool_con">
<panel class="control-panel" />
<CommentPanel :billCode="billCode" ></CommentPanel>
</el-scrollbar>
2024-06-20 05:36:41 +00:00
2024-06-20 04:48:19 +00:00
</div>
</template>
<script>
import { listEmisWaybillProblemFaq, getEmisWaybillProblemFaq, delEmisWaybillProblemFaq, addEmisWaybillProblemFaq, updateEmisWaybillProblemFaq } from "@/api/emis/emisWaybillProblemFaq";
2024-06-20 05:36:41 +00:00
import CommentPanel from '@/views/emis/emisWaybillProblemFaq/commentPanel.vue';
2024-06-24 05:40:52 +00:00
import { parseTime } from "@/utils/custom";
2024-06-20 04:48:19 +00:00
export default {
name: "emisWaybillProblemFaqForm",
props:{
2024-06-20 05:36:41 +00:00
promInfo:{
type:Object
2024-06-20 09:31:46 +00:00
},
2024-06-20 04:48:19 +00:00
},
2024-06-20 05:36:41 +00:00
components: { CommentPanel },
2024-06-20 04:48:19 +00:00
dicts: [
],
data() {
return {
emisWaybillProblemFaqOptions: [],
// 遮罩层
loading: true,
2024-06-20 09:31:46 +00:00
2024-06-20 04:48:19 +00:00
// 表单参数
2024-06-24 05:40:52 +00:00
form: {
// status: "2"
},
2024-06-20 04:48:19 +00:00
// 表单校验
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() {
2024-06-20 09:31:46 +00:00
this.reset();
2024-06-20 04:48:19 +00:00
2024-06-20 09:31:46 +00:00
// if(this.id !=null) {
// this.loading = true;
// getEmisWaybillProblemFaq(this.id).then(response => {
// this.form = response.data;
// this.loading = false;
// });
// }else{
// }
2024-06-20 04:48:19 +00:00
// this.getTreeselect();
},
// 取消按钮
cancel() {
this.reset();
this.$emit("on-cancel");
},
// 表单重置
reset() {
this.form = {
2024-06-24 05:40:52 +00:00
id: this.id,
status: "2",
2024-06-20 04:48:19 +00:00
probId: null,
billCode: null,
title: null,
content: null,
2024-06-24 05:40:52 +00:00
// status: null,
2024-06-20 04:48:19 +00:00
showFlag: null,
replayId: null,
delFlag: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null,
createSite: null,
updateSite: null
};
this.resetForm("form");
},
/** 提交按钮 */
submitForm() {
2024-06-24 05:40:52 +00:00
debugger;
// this.form.id = this.id;this.promInfo
this.$refs["form"].validate(async (valid) => {
2024-06-20 04:48:19 +00:00
if (valid) {
2024-06-24 05:40:52 +00:00
// addEmisWaybillProblemFaq(this.form).then(response => {
// this.$modal.msgSuccess("新增成功");
// this.$emit("on-changed");
// });
let reply = {
// id: null,
probId: this.promInfo.id,//问题件序号
billCode: this.promInfo.billCode,
title: this.promInfo.problemTitle,
content: this.form.content,//具体内容
status: this.form.status,//状态
replayId: this.$store.getters.empCode,//针对的回复的ID
createBy: this.$store.getters.empName,
createTime: parseTime(new Date()),
createSite: this.$store.getters.ownerSiteName,//创建站点
}
let response = await addEmisWaybillProblemFaq(reply);
console.log(commentList)
if(response && response.code == 200){
// commentList.getList();
// this.reversion = {
// status:'',
// content:''
// }
this.$emit("on-changed");
}else{
this.$message.error(response & response.msg || "未知错误")
}
2024-06-20 04:48:19 +00:00
}
});
},
// /** 转换菜单数据结构 */
// 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>