LiuJ 5 dienas atpakaļ
vecāks
revīzija
fe2a7b9de8

+ 17 - 0
src/router/index.js

@@ -599,6 +599,23 @@ export const constantRoutes = [
       }
     ]
 
+  },
+  {
+    path: '/addNcomplaint',
+    component: Layout,
+    children: [
+      {
+        name: '',
+        path: '',
+        component: () => import('@/views/news/addNcomplaint'),
+        meta: {
+          title: '添加投诉举报',
+          hidden: true,
+          breadcrumb: true
+        }
+      }
+    ]
+
   },
       
   // ----------liuj------------

+ 51 - 1
src/store/modules/news.js

@@ -3,7 +3,7 @@ import { getArticleList, addArticle, delArticle, getArticleInfo, updateArticle,
   getGoodInfo, updateGood, websiteList, getWebsiteNavList, getWebsiteNavPool, getWebsiteNavPoolSite,
   getSurveyList,getSurveyInfo, getJobHuntingList, getJobHuntingInfo,addJobHunting,delJobHunting,updateJobHunting,getJobHuntingData,
   getComplaintList,
-  getComplaintInfo, updateComplaint, deleteComplaint,  addComplaint1,  getMSG,  getNoticeList, getNoticeInfo, addNotice, updateNotice, deleteNotice,
+  getComplaintInfo, updateComplaint, deleteComplaint,  addComplaint1,    getMSG,  getNoticeList, getNoticeInfo, addNotice, updateNotice, deleteNotice,
   updateGoodStatus, updateJobHuntingStatus, updateNoticeStatus, updateComplaintStatus,
 } from '@/api/news'
 
@@ -252,6 +252,56 @@ const actions = {
       })
     })
   },
+  getComplaintList({ commit }, data) {
+    return new Promise((resolve, reject) => {
+      getComplaintList(data).then(response => {
+        resolve(response)
+      }).catch(error => {
+        reject(error)
+      })
+    }) 
+  }
+,
+  getComplaintInfo({ commit }, data) {
+    return new Promise((resolve, reject) => {
+      getComplaintInfo(data).then(response => {
+        resolve(response)
+      }).catch(error => {
+        reject(error)
+      })
+    })
+  },
+  updateComplaint({ commit }, data) {
+   
+    return new Promise((resolve, reject) => {
+      updateComplaint(data).then(response => {
+        resolve(response)
+      }).catch(error => {
+        reject(error)
+ 
+      }) 
+    })
+  }
+,
+  deleteComplaint({ commit }, data) {
+    return new Promise((resolve, reject) => {
+      deleteComplaint(data).then(response => {
+        resolve(response)
+      }).catch(error => {
+        reject(error)
+      })
+    })
+  },
+  addComplaint({ commit }, data) {
+    
+    return new Promise((resolve, reject) => {
+      addComplaint(data).then(response => {
+        resolve(response)
+      }).catch(error => {
+        reject(error)
+      })
+    })
+  },
   //20250306  求职信息
 
 

+ 15 - 12
src/views/news/addGood.vue

@@ -135,9 +135,11 @@
             <!--这里是富文本-->
             <myEditor ref="myEditor" v-model="form.detail"></myEditor>
           </el-form-item>
-          <el-form-item label="浏览量:" prop="hits" class="custom-align-right">
+
+          <el-form-item v-if="user_type == 10000" label="浏览量:" prop="hits" class="custom-align-right">
             <el-input type="number" v-model="form.hits" autocomplete="off" placeholder="请输入浏览量"></el-input>
           </el-form-item>
+
           <el-form-item label="联系人:" prop="contact" class="custom-align-right">
             <el-input v-model="form.contact" autocomplete="off" placeholder="请输入联系人"></el-input>
           </el-form-item>
@@ -473,11 +475,11 @@ export default {
         console.log(res)
         this.userType = res.data.type_id;
         this.user_type = res.data.type_id;
-        
+
         if (this.userType != 10000) {
-          this.form.website_id = getWebSiteId() 
+          this.form.website_id = getWebSiteId()
         }
-       
+
         //if(res.data.type_id==10000){}//管理员
         //if(res.data.type_id==4){}//调研员
         //个人会员=1 政务会员=2 企业会员=3 调研员=4 管理员=10000 游客=20000
@@ -524,9 +526,9 @@ export default {
     },
     //1.2 提交表单
     addToServe() {
-      
+
       this.form.website_id = getWebSiteId();
-      console.log("提交时获取网站id:",this.form.website_id)
+      console.log("提交时获取网站id:", this.form.website_id)
       //先进行验证
       this.$refs.form.validate(valid => {
         console.log(this.form.validity, 'this.form.validity-----------------')
@@ -770,11 +772,11 @@ export default {
       this.tags = newTags;
       this.form.keyword = newTags.join(',');
     },
-    selectChange(checked){
-      if(checked==true){
+    selectChange(checked) {
+      if (checked == true) {
         this.form.validity = '1970-01-01 00:00:00';
-      }else{
-        
+      } else {
+
       }
     }
   },
@@ -836,7 +838,7 @@ export default {
       },
       immediate: true // 立即执行一次
     }
-    
+
   },
   mounted() {
     this.user_type = getUseType();
@@ -927,7 +929,8 @@ export default {
 ::v-deep .el-checkbox {
   margin-left: 20px;
 }
-.imgBox{
+
+.imgBox {
   color: #999;
 }
 

+ 75 - 65
src/views/news/addComplaint.vue → src/views/news/addNcomplaint.vue

@@ -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;

+ 1 - 1
src/views/news/creatNews.vue

@@ -107,7 +107,7 @@
               <el-form-item label="作者:" prop="author" class="custom-align-right">
                 <el-input v-model="form.author" autocomplete="off" placeholder="请输入作者"></el-input>
               </el-form-item>
-              <el-form-item label="浏览量:" class="custom-align-right">
+              <el-form-item label="浏览量:" v-if="creatNews_user_type == 10000" class="custom-align-right">
                 <el-input v-model="form.hits" autocomplete="off" placeholder="请输入浏览量"></el-input>
               </el-form-item>
               <el-form-item label="是否为原创:" prop="is_original" class="custom-align-right">

+ 5 - 5
src/views/news/ncomplaintList.vue

@@ -53,9 +53,9 @@
             <el-table-column fixed prop="id" label="编号" width="50"></el-table-column>
             <el-table-column prop="title" label="投诉主题" width="">
             </el-table-column>
-            <el-table-column prop="title" label="投诉类型" width="">
+            <el-table-column prop="department_name" label="投诉类型" width="">
             </el-table-column>
-            <el-table-column prop="type" label="接收人" width="">
+            <el-table-column prop="cityname" label="接收人" width="">
             </el-table-column>
             <el-table-column prop="level" label="处理状态" width="">
               <template slot-scope="scope">
@@ -185,7 +185,7 @@ export default {
         id: id,
         status: status
       }
-      this.$store.dispatch('news/upComplaintStatus', data).then(res => {
+      this.$store.dispatch('news/updateComplaintStatus', data).then(res => {
         if (res.code == 200) {
           this.$message({
             type: 'success',
@@ -225,7 +225,7 @@ export default {
     //跳转到通知发布页面
     goCreat() {
       this.$router.push({
-        path: '/addComplaint',
+        path: '/addNcomplaint',
       });
     },
     goEdit(id) {
@@ -233,7 +233,7 @@ export default {
         id: id
       }
       this.$router.push({
-        path: '/addComplaint',
+        path: '/addNcomplaint',
         query: data
       });
     }