|
@@ -1,52 +1,49 @@
|
|
|
<template>
|
|
|
+
|
|
|
+
|
|
|
<div class="mainBox">
|
|
|
<div class="layerBox">
|
|
|
<tableTitle :name="tableDivTitle" />
|
|
|
<el-form :model="form" ref="form" :rules="formRules" label-position="left" label-width="120px">
|
|
|
<div class="formDiv">
|
|
|
-
|
|
|
- <el-form-item label="标题:" prop="title" class="custom-align-right">
|
|
|
- <el-input v-model="form.title" autocomplete="off" placeholder="请输入标题"></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="类型:" prop="type" class="custom-align-right">
|
|
|
- <el-radio-group v-model="form.type">
|
|
|
- <el-radio :label="1">公告</el-radio>
|
|
|
- <el-radio :label="2">通知</el-radio>
|
|
|
- </el-radio-group>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="级别:" prop="level" class="custom-align-right">
|
|
|
- <el-radio-group v-model="form.level">
|
|
|
- <el-radio :label="1">常规</el-radio>
|
|
|
- <el-radio :label="2">紧急</el-radio>
|
|
|
- <el-radio :label="3">特急</el-radio>
|
|
|
- </el-radio-group>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="内容:" prop="content" class="custom-align-right">
|
|
|
- <el-input v-model="form.content" maxlength="500" autocomplete="off" placeholder="请输入内容" type="textarea"
|
|
|
- rows="10"></el-input>
|
|
|
+ <el-form-item label="投诉标题:" prop="title" class="custom-align-right">
|
|
|
+ <el-input v-model="form.title" autocomplete="off" placeholder="请输入投诉标题"></el-input>
|
|
|
</el-form-item>
|
|
|
+
|
|
|
+
|
|
|
<el-form-item label="发布范围:" prop="city_arr_id" class="custom-align-right">
|
|
|
<el-cascader :key="cascaderKey" v-model="form.city_arr_id" placeholder="请选择发布范围" :props="cityData"
|
|
|
filterable clearable></el-cascader>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="行政职能:" prop="department_arr_id" class="custom-align-right">
|
|
|
+ <el-form-item label="行政职能:" prop="department_arr_id" class="custom-align-right">
|
|
|
<el-cascader :key="searchDepartmentKey" v-model="form.department_arr_id" placeholder="请选择行政职能"
|
|
|
popper-class="my_cascader" :props="searchDepartmentData" filterable clearable></el-cascader>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="发布日期:" prop="timeList" class="custom-align-right">
|
|
|
- <el-date-picker v-model="form.time" type="daterange" range-separator="至" start-placeholder="开始日期"
|
|
|
- end-placeholder="结束日期" :picker-options="pickerOptions">
|
|
|
+
|
|
|
+ <el-form-item label="事件描述:" prop="content" class="custom-align-right">
|
|
|
+ <el-input v-model="form.content" maxlength="500" autocomplete="off" placeholder="请输入事件描述:" type="textarea"
|
|
|
+ rows="10"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="我的要求:" prop="want" class="custom-align-right">
|
|
|
+ <el-input v-model="form.want" maxlength="500" autocomplete="off" placeholder="请输入我的要求:" type="textarea"
|
|
|
+ rows="10"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+
|
|
|
+ <el-form-item label="发生日期:" prop="start" class="custom-align-right">
|
|
|
+ <el-date-picker v-model="form.start" placeholder="请选择发生日期">
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
-
|
|
|
+
|
|
|
<el-form-item label="附件:" class="custom-align-right" prop="">
|
|
|
<div class="uploaderBox" @mouseenter="hovering = true" mouseleave="hovering = false">
|
|
|
<el-upload class="avatar-uploader" action="#" :show-file-list="false" :before-upload="beforeAvatarUpload">
|
|
|
<!-- 预览图片 -->
|
|
|
- <img v-if="file && (fileType == 'jpeg' || fileType =='png' )" :src="file" class="avatar">
|
|
|
- <div v-if="file && (fileType == 'pdf' || fileType =='word' )" class="chooseImgDiv1">
|
|
|
+ <img v-if="file && (fileType == 'jpeg' || fileType == 'png')" :src="file" class="avatar">
|
|
|
+ <div v-if="file && (fileType == 'pdf' || fileType == 'word')" class="chooseImgDiv1">
|
|
|
<div>
|
|
|
- <div>{{file}}</div>
|
|
|
+ <div>{{ file }}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div v-else class="chooseImgDiv">
|
|
@@ -63,23 +60,30 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="建立群聊:" prop="is_group" class="custom-align-right">
|
|
|
- <el-radio-group v-model="form.is_group" :disabled="this.$route.query.id!=undefined">
|
|
|
- <el-radio :label="1">是</el-radio>
|
|
|
- <el-radio :label="0">否</el-radio>
|
|
|
- </el-radio-group>
|
|
|
- </el-form-item>
|
|
|
-
|
|
|
- <el-form-item label="群聊名称:" prop="group_name" class="custom-align-right" v-if="form.is_group == 1" :disabled="this.$route.query.id!=undefined">
|
|
|
- <el-input v-model="form.group_name" autocomplete="off" placeholder="请输入群聊名称"></el-input>
|
|
|
+ <el-form-item label="投诉方式" prop="type" class="custom-align-right">
|
|
|
+ <el-radio-group v-model="form.type">
|
|
|
+ <el-radio :label="1">匿名</el-radio>
|
|
|
+ <el-radio :label="2">实名</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </el-form-item>
|
|
|
+ <!-- <el-form-item label="建立群聊:" prop="is_group" class="custom-align-right">
|
|
|
+ <el-radio-group v-model="form.is_group" :disabled="this.$route.query.id != undefined">
|
|
|
+ <el-radio :label="1">是</el-radio>
|
|
|
+ <el-radio :label="0">否</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
</el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="群聊名称:" prop="group_name" class="custom-align-right" v-if="form.is_group == 1"
|
|
|
+ :disabled="this.$route.query.id != undefined">
|
|
|
+ <el-input v-model="form.group_name" autocomplete="off" placeholder="请输入群聊名称"></el-input>
|
|
|
+ </el-form-item> -->
|
|
|
</div>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
<div class="bottomBtnBox">
|
|
|
<el-button type="info" @click="returnPage">返回</el-button>
|
|
|
<el-button type="primary" @click="editToServe" v-if="editStatus == true">确定</el-button>
|
|
|
- <el-button type="primary" @click="addToServe" v-else>发布通知</el-button>
|
|
|
+ <el-button type="primary" @click="addToServe" v-else>发布投诉举报</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -128,10 +132,11 @@ export default {
|
|
|
formLabelWidth: '80px',//表单的长度
|
|
|
//1.表单项 start ------------------------------------------------------------>
|
|
|
editStatus: false,
|
|
|
- tableDivTitle: "添加通知",
|
|
|
+ tableDivTitle: "添加投诉举报",
|
|
|
searchCascaderKey: 0, //列表缓存key
|
|
|
website_id: 2,
|
|
|
file: '',
|
|
|
+ userType: 1, //用户类型 1:普通用户,
|
|
|
pickerOptions: {
|
|
|
selectableRange: '1900-01-01 to 2100-12-31', // 允许选择的日期范围
|
|
|
// disabledDate(time) {
|
|
@@ -142,8 +147,8 @@ export default {
|
|
|
//提交表单
|
|
|
form: {
|
|
|
//1.1使用了外链
|
|
|
- title: '',//通知标题
|
|
|
- type: 1,//类型:1:公告,2:通知
|
|
|
+ title: '',//投诉举报标题
|
|
|
+ type: 1,//类型:1:公告,2:投诉举报
|
|
|
level: 1,//级别:1:常规,2:紧急,3:特急
|
|
|
city_arr_id: [],//行政区划
|
|
|
city_id: '',//城市id
|
|
@@ -152,8 +157,9 @@ export default {
|
|
|
file: "",//文件路径
|
|
|
department_arr_id: [],//部门id
|
|
|
department_id: '',//部门id
|
|
|
- is_group: 0,//是否创建群聊:1:是,0:否
|
|
|
- group_name: '',//群聊名称
|
|
|
+ want: "",//我的要求
|
|
|
+ type: 1,//发布类型:1:匿名,2:实名
|
|
|
+ start: '',//开始时间
|
|
|
},
|
|
|
//1.2 表单验证规则
|
|
|
formRules: {
|
|
@@ -389,24 +395,23 @@ export default {
|
|
|
this.form.department_id = this.form.department_arr_id.at(-1) || 0;
|
|
|
this.form.department_arr_id = JSON.stringify(this.form.department_arr_id);
|
|
|
}
|
|
|
- console.log(typeof this.form.time, '---=-==-=')
|
|
|
- console.log(this.form.time.length, '---=-==-=')
|
|
|
- if (typeof this.form.time=='object' && this.form.time.length > 0) {
|
|
|
- this.form.start = this.formatDate(this.form.time[0]);
|
|
|
- this.form.end = this.formatDate(this.form.time[1]);
|
|
|
- delete this.form.time;
|
|
|
- }
|
|
|
+
|
|
|
delete this.form.cat_arr_id;
|
|
|
delete this.form.timelist;
|
|
|
delete this.form.catid;
|
|
|
this.form.file = this.file;
|
|
|
console.log(this.form, 'this.form-----------------')
|
|
|
- this.$store.dispatch('news/addNotice', this.form).then(res => {
|
|
|
+ if (this.userType == 10000) {
|
|
|
+ this.form.status = 2
|
|
|
+ } else {
|
|
|
+ this.form.status = 1
|
|
|
+ }
|
|
|
+ this.$store.dispatch('news/addComplaint1', this.form).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
//汇报结果
|
|
|
this.$message({
|
|
|
type: 'success',
|
|
|
- message: '已成功添加通知!'
|
|
|
+ message: '已成功添加投诉举报!'
|
|
|
});
|
|
|
this.cleatForm();
|
|
|
//返回列表页
|
|
@@ -414,7 +419,7 @@ export default {
|
|
|
} else {
|
|
|
this.$message({
|
|
|
type: 'error',
|
|
|
- message: "通知发布失败,请稍后再试!"
|
|
|
+ message: "投诉举报发布失败,请稍后再试!"
|
|
|
});
|
|
|
}
|
|
|
})
|
|
@@ -440,7 +445,7 @@ export default {
|
|
|
//2.跳转操作 start ------------------------------------------------------------>
|
|
|
returnPage() {
|
|
|
this.$router.push({
|
|
|
- path: '/noticeList',
|
|
|
+ path: '/ncomplaintList',
|
|
|
});
|
|
|
},
|
|
|
//跳转操作 end ------------------------------------------------------------>
|
|
@@ -451,7 +456,7 @@ export default {
|
|
|
let data = {
|
|
|
id: this.$route.query.id
|
|
|
};
|
|
|
- this.$store.dispatch('news/getNoticeInfo', data).then(res => {
|
|
|
+ this.$store.dispatch('news/getComplaintInfo', data).then(res => {
|
|
|
console.log(res);
|
|
|
this.form.name = res.data.name;
|
|
|
// 回显导航池
|
|
@@ -472,11 +477,11 @@ export default {
|
|
|
this.form.cat_id = res.data.cat_id;
|
|
|
this.form.time = [res.data.start, res.data.end];
|
|
|
this.form.file = res.data.file;
|
|
|
- this.file = res.data.file;
|
|
|
+ this.file = res.data.file;
|
|
|
const filePath = res.data.file;
|
|
|
const fileExtension = filePath.split('.').pop().toLowerCase();
|
|
|
this.fileType = fileExtension; // 设置文件类型
|
|
|
- this.form.is_group = parseInt(res.data.is_group );
|
|
|
+ this.form.is_group = parseInt(res.data.is_group);
|
|
|
this.form.group_name = res.data.group_name;
|
|
|
})
|
|
|
},
|
|
@@ -539,7 +544,7 @@ export default {
|
|
|
this.form.department_arr_id = JSON.stringify(this.form.department_arr_id);
|
|
|
}
|
|
|
console.log(typeof this.form.time, '---=-==-=')
|
|
|
- if (typeof this.form.time=='object' && this.form.time.length > 0) {
|
|
|
+ if (typeof this.form.time == 'object' && this.form.time.length > 0) {
|
|
|
this.form.start = this.formatDate(this.form.time[0]);
|
|
|
this.form.end = this.formatDate(this.form.time[1]);
|
|
|
delete this.form.time;
|
|
@@ -549,14 +554,21 @@ export default {
|
|
|
delete this.form.catid;
|
|
|
this.form.file = this.file;
|
|
|
console.log(this.form, 'this.form-----------------')
|
|
|
- this.$store.dispatch('news/updateNotice', this.form).then(res => {
|
|
|
+
|
|
|
+ if (this.userType == 10000) {
|
|
|
+ this.form.status = 2
|
|
|
+ } else {
|
|
|
+ this.form.status = 1
|
|
|
+ }
|
|
|
+
|
|
|
+ this.$store.dispatch('news/updateComplaint', this.form).then(res => {
|
|
|
if (res.code != 200) {
|
|
|
this.$message.error("修改失败,请稍后再试!");
|
|
|
} else {
|
|
|
//汇报结果
|
|
|
this.$message({
|
|
|
type: 'success',
|
|
|
- message: '已成功编辑通知!'
|
|
|
+ message: '已成功编辑投诉举报!'
|
|
|
});
|
|
|
this.cleatForm();
|
|
|
//返回列表页
|
|
@@ -586,13 +598,13 @@ export default {
|
|
|
if (this.$route.query.id != undefined) {
|
|
|
this.editId = this.$route.query.id;
|
|
|
this.editStatus = true;
|
|
|
- this.tableDivTitle = "编辑通知";
|
|
|
+ this.tableDivTitle = "编辑投诉举报";
|
|
|
|
|
|
- console.log("编辑通知")
|
|
|
+ console.log("编辑投诉举报")
|
|
|
this.getMainData();
|
|
|
} else {
|
|
|
this.editStatus = false;
|
|
|
- console.log("添加通知!")
|
|
|
+ console.log("添加投诉举报!")
|
|
|
}
|
|
|
this.fetchWebsiteOptions();
|
|
|
this.getUserInfo();
|
|
@@ -602,8 +614,6 @@ export default {
|
|
|
};
|
|
|
</script>
|
|
|
<style scoped lang="less">
|
|
|
-
|
|
|
-
|
|
|
//执行v-deep穿透scope选择器 start------------------------------------------------------------>*/
|
|
|
::v-deep .custom-form-item>.el-form-item__label {
|
|
|
line-height: 140px !important;
|