liuhj 1 年之前
父节点
当前提交
c10420c0aa

+ 1 - 0
src/components/Login.vue

@@ -118,6 +118,7 @@ export default {
                 console.log(res);
                 if (res.data.code == 200) {
                     localStorage.setItem('userinif', JSON.stringify(res.data.data));
+                    localStorage.setItem('unReadCount', JSON.stringify(res.data.data.unReadCount));
                     that.fullscreenLoading = false;
                     for (var l = 0; l < res.data.data.authData.length; l++) {
                         if (res.data.data.authData[l].modulName == '主页') {

+ 1 - 1
src/components/OP/AirTicketRes.vue

@@ -7,7 +7,7 @@
                 </div>
                 <div style="display: flex;justify-content: space-between;">
                     <div style="width: 60%;">
-                        <el-select v-model="DiId" placeholder="团组选择" clearable filterable
+                        <el-select style="width: 300px;" v-model="DiId" placeholder="团组选择" clearable filterable
                             @change="AirTicketResSelectChange">
                             <el-option v-for="item in AirTicketResSelectData" :key="item.id" :label="item.groupName"
                                 :value="item.id">

+ 4 - 2
src/components/OP/CarTouristGuideGrounContent.vue

@@ -55,7 +55,7 @@
                         </el-table-column>
                         <el-table-column label="金额/币种" width="400">
                             <template slot-scope="scope">
-                                <div class="el-input-number-style">
+                                <div class="el-input-number-style pice-ys">
                                     <el-input-number placeholder="请输入金额" v-model="scope.row.price" :controls="false"
                                         @change="PriceChange"></el-input-number>
 
@@ -461,7 +461,9 @@ export default {
 .el-input-number-style .el-input input {
     text-align: left;
 }
-
+.pice-ys .el-input-number{
+    width: 250px;
+}
 @media screen and (max-width: 1700px) {
     .appraise-box>div {
         width: 48%;

+ 2 - 5
src/components/OP/Customers.vue

@@ -17,7 +17,7 @@
                                 </el-option>
                             </el-select>
                         </div>
-                        <div style="width: 25%;"><el-input v-model="VisaClient" placeholder="请输入客户名称" clearable></el-input>
+                        <div style="width: 25%;margin-left: 10px;"><el-input v-model="VisaClient" placeholder="请输入客户名称" clearable></el-input>
                         </div>
                         <div style="width: 25%;margin-left: 10px;"><el-button type="primary"
                                 @click="QueryByVisaClient">查询</el-button>
@@ -132,7 +132,6 @@ export default {
                 }
             }).then(function (res) {
                 if (res.data.code == 200) {
-                    debugger
                     that.delegationInfoList = res.data.data.groupName;
                     that.DiId = that.$route.query.diId
                     if (that.DiId == undefined) {
@@ -140,7 +139,6 @@ export default {
                         that.DiId = that.delegationInfoList[0].id;
                     } else {
                         for (let index = 0; index < that.delegationInfoList.length; index++) {
-                            debugger
                             if (that.delegationInfoList[index].id == that.DiId) {
                                 that.delegationInfo = that.delegationInfoList[index];
                                 that.DiId = that.delegationInfoList[index].id;
@@ -180,7 +178,6 @@ export default {
                 }
             }).then(function (res) {
                 if (res.data.code == 200) {
-                    debugger
                     that.tableDatas = res.data.data;
                     that.tableData = that.tableDatas
                     if (that.tableDatas.length != 0) {
@@ -209,7 +206,6 @@ export default {
 
         },
         addIf() {
-            debugger
             if (this.DiId != 0 && this.DiId != '' && this.DiId != undefined) {
                 this.$router.push({
                     path: "/home/OpCustomers",
@@ -300,6 +296,7 @@ export default {
     padding: 10px;
     box-shadow: 0 0 5px #0005;
     border-radius: 10px;
+    min-height: 830px;
 }
 
 .communal-title {

+ 1 - 1
src/components/OP/DecreasePayments.vue

@@ -8,7 +8,7 @@
                 </div>
                 <div style="display: flex;">
                     <div style="width: 90%;">
-                        <el-select v-model="DiId" placeholder="团组选择" clearable filterable @change="DecreasePaymentsChange">
+                        <el-select style="width:400px" v-model="DiId" placeholder="团组选择" clearable filterable @change="DecreasePaymentsChange">
                             <el-option v-for="item in delegationInfoList" :key="item.id" :label="item.teamName"
                                 :value="item.id">
                             </el-option>

+ 4 - 5
src/components/OP/OpCustomers.vue

@@ -95,7 +95,7 @@
                         </el-form-item>
                     </div>
                 </div>
-                <div style="display: flex;">
+                <!-- <div style="display: flex;">
                     <div style="width: 25%;">
                         <el-form-item label="附件" prop="attachment" label-width="160px">
 
@@ -103,13 +103,12 @@
                                 style="width: 200px;" :before-remove="beforeRemove" :limit="1" :on-exceed="exceed"
                                 :action="uploadURL" :headers="headers" :auto-upload="false" :on-change="onChange">
                                 <el-button slot="trigger" size="small" type="primary">选取文件</el-button>
-                                <!-- <el-button style="margin-left: 10px;" size="small" type="success"
-                                    @click="submitUpload">上传到服务器</el-button> -->
+                                
                             </el-upload>
 
                         </el-form-item>
                     </div>
-                </div>
+                </div> -->
                 <div style="display: flex;">
                     <div style="width: 100%;">
                         <el-form-item label="备 注:" prop="Remark" label-width="160px">
@@ -260,7 +259,7 @@
                     </div>
                 </div>
                 <el-form-item>
-                    <div style="margin-left: 60%;">
+                    <div style="text-align: right;">
                         <el-button type="primary" @click="addBtn">保存</el-button>
 
                         <el-button @click="EscAdd">取消</el-button>

+ 1 - 1
src/components/OP/OpLtinerary.vue

@@ -222,7 +222,7 @@ export default {
 }
 .opname-box{
     display: flex;
-    justify-content: end;
+    justify-content: flex-end;
 }
 .opname-head-li:nth-child(1){
     margin-right: 10px;

+ 3 - 1
src/components/OP/OpVisaPriec.vue

@@ -1,3 +1,4 @@
+
 <template>
     <div class="car_add">
         <div>
@@ -260,7 +261,7 @@
                     </div>
                 </div>
                 <el-form-item>
-                    <div style="margin-left: 60%;">
+                    <div style="text-align: right;">
                         <el-button type="primary" @click="addBtn">保存</el-button>
 
                         <el-button @click="EscAdd">取消</el-button>
@@ -617,6 +618,7 @@ export default {
     padding: 10px;
     box-shadow: 0 0 5px #0005;
     border-radius: 10px;
+    
 }
 
 .car_add .communal-title {

+ 2 - 5
src/components/OP/VisaPriec.vue

@@ -17,7 +17,7 @@
                                 </el-option>
                             </el-select>
                         </div>
-                        <div style="width: 25%;"><el-input v-model="VisaClient" placeholder="请输入费用名称" clearable></el-input>
+                        <div style="width: 25%;margin-left: 10px;"><el-input v-model="VisaClient" placeholder="请输入费用名称" clearable></el-input>
                         </div>
                         <div style="width: 25%;margin-left: 10px;"><el-button type="primary"
                                 @click="QueryByVisaClient">查询</el-button>
@@ -133,7 +133,6 @@ export default {
                 }
             }).then(function (res) {
                 if (res.data.code == 200) {
-                    debugger
                     that.delegationInfoList = res.data.data.groupName;
                     that.DiId = that.$route.query.diId
                     if (that.DiId == undefined) {
@@ -141,7 +140,6 @@ export default {
                         that.DiId = that.delegationInfoList[0].id;
                     } else {
                         for (let index = 0; index < that.delegationInfoList.length; index++) {
-                            debugger
                             if (that.delegationInfoList[index].id == that.DiId) {
                                 that.delegationInfo = that.delegationInfoList[index];
                                 that.DiId = that.delegationInfoList[index].id;
@@ -183,7 +181,6 @@ export default {
                 }
             }).then(function (res) {
                 if (res.data.code == 200) {
-                    debugger
                     that.tableDatas = res.data.data;
                     that.tableData = that.tableDatas
                     if (that.tableDatas.length != 0) {
@@ -215,7 +212,6 @@ export default {
 
         },
         addIf() {
-            debugger
             if (this.DiId != 0 && this.DiId != '' && this.DiId != undefined) {
                 this.$router.push({
                     path: "/home/OpVisaPriec",
@@ -286,6 +282,7 @@ export default {
     padding: 10px;
     box-shadow: 0 0 5px #0005;
     border-radius: 10px;
+    min-height: 830px;
 }
 
 .communal-title {

+ 1 - 1
src/components/Resource/InvitationOfficialActivityData.vue

@@ -27,7 +27,7 @@
                     </div>
                 </div>
                 <div class="communal-box" style="margin-top: 10px;">
-                    <el-select style="margin-right: 15px;" v-model="CreateUserId" placeholder="录入者" filterable clearable>
+                    <el-select style="margin-right: 15px;width:218px;" v-model="CreateUserId" placeholder="录入者" filterable clearable>
                         <el-option v-for="item in CreateUserList" :key="item.id" :label="item.cnName" :value="item.id">
                         </el-option>
                     </el-select>

+ 206 - 67
src/components/home.vue

@@ -4,11 +4,48 @@
       <el-dialog
       style=""
       top="0"
-      title="消息"
+      title="消息通知"
       :visible.sync="dialogVisible"
       width="30%">
         <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
-          <el-tab-pane name="first">
+          <el-tab-pane v-for="(msgitem,index) in msgtype" :key="index" :label="msgitem.id+''" :name="msgitem.name">
+            <span slot="label">
+              {{ msgitem.name }}
+              <el-badge :hidden="msgitem.unReadCount==0?true:false" :value="msgitem.unReadCount" :max="9999"></el-badge>
+            </span>
+          </el-tab-pane>
+          <div class="msg-box">
+            <div class="read-btn">
+              
+              <el-button type="primary" @click="taskclicks(2)"  size="mini" :plain="tasknobtn" >未读</el-button>
+              <el-button type="primary" @click="taskclicks(3)" size="mini" :plain="taskbtn" >已读</el-button>
+            </div>
+            <div class="scroll-box">
+              <div class="news-box" v-for="(item,index) in msglist" :key="index">
+                <div class="news-box-list">
+                  <div class="news-list-hade">
+                    <div>{{item.title}}</div>
+                    <div>所属部门: {{item.issuerDep}}</div>
+                  </div>
+                  <div class="news-list-content" v-html="item.content">
+                  </div>
+                  <div class="news-list-posts">
+                    <div>发布人: {{item.issuerUser}}</div>
+                    <div>发布时间: {{item.releaseTime}}</div>
+                  </div>
+                  <div class="news-list-btn" >
+                    <el-button @click="DeleMsg(index,item)" v-if="item.isRead==0" type="primary">确认已读</el-button>
+                    <el-button v-if="item.isRead==1" type="info">已读</el-button>
+                  </div>
+                </div>
+              </div>
+              <div v-if="count>10&&msglist.length<count" class="loadmore">
+                <el-button @click="loadadd" size="mini">加载更多</el-button>
+              </div>
+              <el-divider v-if="msglist.length>=count" style="">没有更多了!</el-divider>
+            </div>
+          </div>
+          <!-- <el-tab-pane name="first">
             <span slot="label">
               任务操作通知
               <el-badge :hidden="tasknot==0?true:false" :value="tasknot" :max="9999"></el-badge>
@@ -81,7 +118,7 @@
                 暂无通知
               </div>
             </div>
-          </el-tab-pane>
+          </el-tab-pane> -->
         </el-tabs>
       </el-dialog>
     </div>
@@ -163,7 +200,7 @@
               <i class="icon-shiyonggongju"></i>
             </div>
             <div class="message">
-              <el-badge :value="12" class="item">
+              <el-badge :value="unReadCount" class="item">
                 <i class="icon-tongzhi" @click="dialogVisible= true"></i>
               </el-badge>
             </div>
@@ -299,7 +336,7 @@ export default {
       dialogVisible: false ,
       newstasklist:[],
       newsgrouplist:[],
-      activeName: 'first',
+      activeName: '',
       tasknot:0,//任务未读条数
       groupnot:0,//团组未读条数
       tasknotlist:[],//任务未读
@@ -307,9 +344,17 @@ export default {
       groupnotlist:[],//团组未读
       groupReadlist:[],//团组以读
       taskbtn:true,//plain任务已读
-      tasknobtn:true,//plain任务未读
+      tasknobtn:false,//plain任务未读
       groupbtn:true,//plain团组已读
       groupnobtn:true,//plain团组未读
+      unReadCount:0,//未读总条数
+      msgtype:[],//未读总条数
+      pageIndex:1,//页码
+      pageSize:10,//条数
+      type:0,//类型
+      readStatus:2,//状态
+      msglist:[],//list
+      count:0,//list数量
     };
   },
   // components: {
@@ -419,12 +464,100 @@ export default {
       console.log('测试');
     },
     handleClick(tab, event) {
+      this.pageIndex=1;
+      this.pageSize=10;
+      this.msglist=[];
       console.log(tab, event);
+      console.log(tab.label);
+      this.type=Number(tab.label);
+      this.PotsMessagePageList();
+    },
+    //已读未读切换
+    taskclicks(val){
+      if(val==2){
+        this.tasknobtn=false;
+        this.taskbtn=true;
+      }else{
+        this.tasknobtn=true;
+        this.taskbtn=false;
+      }
+      this.readStatus=val;
+      this.pageIndex=1;
+      this.pageSize=10;
+      this.msglist=[];
+      this.PotsMessagePageList();
+    },
+    //加载更多
+    loadadd(){
+      this.pageIndex++
+      this.PotsMessagePageList()
+    },
+    //消息list
+    PotsMessagePageList(){
+      console.log(this.type)
+      var url = "/api/System/PotsMessagePageList"
+      var that = this
+      this.$axios({
+          method: 'post',
+          url: url,
+          headers: {
+              Authorization: 'Bearer ' + that.token
+          },
+          data:{
+            portType:1,
+            pageIndex:that.pageIndex,
+            pageSize:that.pageSize,
+            type:that.type,
+            userId:that.userId,
+            readStatus:that.readStatus
+          }
+      }).then(function (res) {
+          console.log(res)
+          if(res.data.code==200){
+            var magarr=res.data.data;
+            that.count=res.data.count;
+            for(let j=0;j<magarr.length;j++){
+              that.msglist.push(magarr[j])
+            }
+          }else{
+            that.$message.error(res.data.msg);
+          }
+      }).catch(function (error) {
+          that.$message.error("获取消息列表失败!");
+      });
     },
     //任务通知切换
     newstasklistclick(){
       console.log(this.newstasklist)
-       
+    },
+    //消息类型
+    PotsMsgTypeData(){
+      this.msglist=[];
+      var url = "/api/System/PotsMsgTypeData"
+      var that = this
+      this.$axios({
+          method: 'post',
+          url: url,
+          headers: {
+              Authorization: 'Bearer ' + that.token
+          },
+          data:{
+            portType:1,
+            userId:that.userId
+          }
+      }).then(function (res) {
+          console.log(res)
+          if(res.data.code==200){
+            that.msgtype=res.data.data;
+            that.activeName=that.msgtype[0].name;
+            that.type=that.msgtype[0].id;
+            that.PotsMessagePageList()
+          }else{
+            that.$message.error(res.data.msg);
+          }
+      }).catch(function (error) {
+          that.$message.error("获取消息类型失败!");
+      });
     },
     //消息列表
     PsotMsgPageList(){
@@ -439,47 +572,14 @@ export default {
             data:{
               portType:1,
               pageIndex:1,
-              pageSize:10,
+              pageSize:100,
               userId:that.userId
             }
         }).then(function (res) {
             console.log(res)
             if(res.data.code==200){
                 //初始化
-                that.tasknotlist=[];
-                that.taskReadlist=[];
-                that.groupnotlist=[];
-                that.groupReadlist=[];
-                that.taskbtn=true;//plain任务已读
-                that.tasknobtn=true;//plain任务未读
-                that.groupbtn=true;//plain团组已读
-                that.groupnobtn=true;//plain团组未读
-                var listdata=res.data.data;
-                // that.newstasklist=res.data.data.taskNotification.taskNotificationData;
-                that.tasknot=res.data.data.taskNotification.unReadCount;
-                // that.newsgrouplist=res.data.data.operationNotification.operationNotificatioData;
-                that.groupnot=res.data.data.operationNotification.unReadCount;
-                console.log(listdata.taskNotification.taskNotificationData)
-                //任务
-                for(let i=0;i<listdata.taskNotification.taskNotificationData.length;i++){
-                  if(listdata.taskNotification.taskNotificationData[i].isRead==0){
-                    that.tasknotlist.push(listdata.taskNotification.taskNotificationData[i]);
-                  }else{
-                    that.taskReadlist.push(listdata.taskNotification.taskNotificationData[i]);
-                  }
-                }
-                that.newstasklist=that.tasknotlist;
-                that.tasknobtn=false;
-                //团组
-                for(let j=0;j<listdata.operationNotification.operationNotificatioData.length;j++){
-                  if(listdata.operationNotification.operationNotificatioData[j].isRead==0){
-                    that.groupnotlist.push(listdata.operationNotification.operationNotificatioData[j]);
-                  }else{
-                    that.groupReadlist.push(listdata.operationNotification.operationNotificatioData[j]);
-                  }
-                }
-                that.newsgrouplist=that.groupnotlist;
-                that.groupnobtn=false;
+                
             }else{
                 that.$message.error(res.data.msg);
             }
@@ -489,32 +589,61 @@ export default {
     },
     //消息确认已读
     DeleMsg(index,row){
-      console.log(index,row)
-      var url = "/api/System/DeleMsg"
-      var that = this
-      this.$axios({
-          method: 'post',
-          url: url,
-          headers: {
-              Authorization: 'Bearer ' + that.token
-          },
-          data:{
-            portType:1,
-            pageIndex:0,
-            pageSize:0,
-            msgId:row.id,
-            userId:that.userId
-          }
-      }).then(function (res) {
-          console.log(res)
-          if(res.data.code==200){
-            
-          }else{
+      this.$confirm('此操作将认定你已知晓此通知?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        var url = "/api/System/SetMessageRead"
+        var that = this
+        this.$axios({
+            method: 'post',
+            url: url,
+            headers: {
+                Authorization: 'Bearer ' + that.token
+            },
+            data:{
+              portType:1,
+              msgId:row.id,
+              userId:that.userId
+            }
+        }).then(function (res) {
+            console.log(res)
+            if(res.data.code==200){
+              if(that.type==1020){
+                that.$router.push({ path: "/home/TaskList"});
+              }
+              that.uplocal();
+              that.PotsMsgTypeData();
+              that.$message({
+                type: 'success',
+                message: res.data.msg
+              });
+            }else{
               that.$message.error(res.data.msg);
-          }
-      }).catch(function (error) {
-          that.$message.error("确认已读失败!");
+            }
+        }).catch(function (error) {
+            that.$message.error("确认已读失败!");
+        });
+        
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消确认已读'
+        });          
       });
+      console.log(index,row)
+      console.log(this.type)
+      
+    },
+    //修改未读条数
+    uplocal(){
+      console.log(this.msgtype.unReadCount);
+      window.localStorage.removeItem('unReadCount');
+      this.unReadCount--;
+      this.msgtype.unReadCount--;
+      console.log(this.msgtype.unReadCount);
+      localStorage.setItem('unReadCount', JSON.stringify(this.unReadCount));
     },
     //任务切换
     taskclick(text){
@@ -604,11 +733,15 @@ export default {
   mounted() {
     this.userId=JSON.parse(localStorage.getItem('userinif')).userInfo.userId;
     this.token=JSON.parse(localStorage.getItem('userinif')).token;
+    this.unReadCount=JSON.parse(localStorage.getItem('unReadCount'));
     this.removal();
     this.radioChange(false);
     this.ifIndexValue();
     this.getmenu();
     this.PsotMsgPageList();
+    this.PotsMsgTypeData();
+    // setTimeout(this.PotsMessagePageList(),500)
+    
     setInterval(this.PsotMsgPageList, 300000);
     // setInterval(this.PsotMsgPageList, 3000);
     // this.chatHub();
@@ -1052,7 +1185,13 @@ i.icon-tongzhi {
 .home-dialog .el-dialog__header{
   padding: 10px 20px;
 }
-
+.news-list-content{
+  line-height: 20px;
+}
+.loadmore{
+  margin-top: 20px;
+  text-align: center;
+}