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

193 lines
5.6 KiB
Vue
Raw Normal View History

2024-06-20 04:48:19 +00:00
<template>
<div >
2024-06-28 03:20:30 +00:00
<div v-if="hideSubmit"></div>
<div v-else>
<el-form ref="form" :model="form" size="mini" :rules="rules" label-width="80px">
<el-row :gutter="0" style="display: flex;flex-wrap: wrap;">
2024-06-20 04:48:19 +00:00
<el-col :span="24">
2024-06-24 14:36:04 +00:00
<el-form-item label="处理状态" prop="dealResult">
2024-06-24 05:40:52 +00:00
<!-- <el-input v-model="form.status" placeholder="" /> -->
2024-06-24 14:36:04 +00:00
<el-select v-model="form.dealResult" :placeholder="$t('全部')">
2024-06-24 05:40:52 +00:00
<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-28 03:20:30 +00:00
</div>
<el-scrollbar class="kr-designer-tool_con">
<!-- <Panel class="control-panel" /> -->
<CommentPanel ref="comment" :probId="probId" ></CommentPanel>
</el-scrollbar>
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 08:08:02 +00:00
import Panel from '@/components/PrintDesigner/base/panel/index.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:{
2024-06-28 03:20:30 +00:00
type:Object
2024-06-20 09:31:46 +00:00
},
2024-06-28 03:20:30 +00:00
hideSubmit: {
type: Boolean
}
2024-06-20 04:48:19 +00:00
},
2024-06-24 08:08:02 +00:00
components: { CommentPanel, Panel },
2024-06-20 04:48:19 +00:00
dicts: [
],
data() {
return {
emisWaybillProblemFaqOptions: [],
// 遮罩层
loading: true,
2024-06-24 08:08:02 +00:00
changed: false,
2024-06-20 04:48:19 +00:00
// 表单参数
2024-06-24 05:40:52 +00:00
form: {
// status: "2"
},
2024-06-28 03:20:30 +00:00
hideSubmit: false,
2024-06-24 14:36:04 +00:00
probId: this.promInfo.id,
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: {
2024-06-24 08:08:02 +00:00
"promInfo": {
2024-06-20 04:48:19 +00:00
handler (newValue, oldValue) {
2024-06-24 14:36:04 +00:00
this.promInfo=newValue;
this.probId = this.promInfo.id;
2024-06-20 04:48:19 +00:00
this.initData();
},
deep: true
2024-06-28 03:20:30 +00:00
},
"hideSubmit": {
handler (newValue, oldValue) {
this.hideSubmit=newValue;
this.initData();
},
deep: true
2024-06-20 04:48:19 +00:00
}
},
created() {
this.initData();
},
methods: {
initData() {
2024-06-28 03:20:30 +00:00
debugger;
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();
2024-06-24 08:08:02 +00:00
// if(this.changed){
// this.$emit("on-changed");
// }else{
// this.$emit("on-cancel");
// }
this.$emit("on-changed");
2024-06-20 04:48:19 +00:00
},
// 表单重置
reset() {
this.form = {
2024-06-24 05:40:52 +00:00
id: this.id,
2024-06-26 10:16:42 +00:00
// status: "2",
2024-06-20 04:48:19 +00:00
probId: null,
billCode: null,
title: null,
content: null,
2024-06-26 10:16:42 +00:00
dealResult: "1",
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,//具体内容
2024-06-26 10:16:42 +00:00
// status: this.form.status,//状态
2024-06-24 14:36:04 +00:00
dealResult: this.form.dealResult,//状态
2024-06-24 05:40:52 +00:00
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);
if(response && response.code == 200){
2024-06-24 08:08:02 +00:00
// this.$emit("on-changed");
this.changed = true;
this.$refs.comment.getList();
2024-06-24 05:40:52 +00:00
}else{
2024-08-04 15:39:57 +00:00
this.$modal.msgError(response & response.msg || "未知错误")
2024-06-24 05:40:52 +00:00
}
2024-06-26 10:16:42 +00:00
this.form.content = "";
2024-06-20 04:48:19 +00:00
}
});
},
}
};
</script>