qinbai 3 anni fa
parent
commit
1374759669

+ 37 - 0
src/api/logs.js

@@ -61,4 +61,41 @@ export const getErrorLogs = (id) => {
     }
   })
 }
+//消息列表
+export const getMsgLogs = () => {
+  return request({
+    url: '/api/blade-client/message/list',
+    method: 'get',
+  })
+}
+
+//socket 辅助接口
+export const getMessage = () => {
+  return request({
+    url: '/api/blade-client/message/getUserMessage',
+    method: 'get',
+  })
+}
+
+//推送消息
+export const saveMessage = (data) => {
+  return request({
+    url: '/api/blade-client/message/save',
+    method: 'post',
+    data:data
+  })
+}
+
+//消息列表
+export const getMsgDetail = (id) => {
+  return request({
+    url: '/api/blade-client/message/detail',
+    method: 'get',
+    params : {
+      id:id
+    }
+  })
+}
+
+
 

+ 1 - 1
src/components/check/check.vue

@@ -2,7 +2,7 @@
   <div>
     <avue-form class="trading-form" :option="option" ref="form" v-model="form">
     </avue-form>
-    <div style="margin-left: 69%;padding: 10px">
+    <div style="margin-left: 60%;padding: 10px">
       <el-button size="small" @click="$emit('choceCheckFun')">关闭</el-button>
       <el-button type="warning" size="small" @click="submit(2)">审批驳回</el-button>
       <el-button type="primary" size="small" @click="submit(1)">审批通过</el-button>

+ 62 - 23
src/page/index/top/top-notice.vue

@@ -3,7 +3,7 @@
               width="350"
               trigger="click">
 
-    <el-tabs v-model="activeName">
+    <el-tabs v-model="activeName" style="align-items: center">
       <el-tab-pane label="消息"
                    name="first">
       </el-tab-pane>
@@ -11,17 +11,20 @@
     <el-scrollbar style="height:300px">
       <avue-notice :data="data"
                    :option="option"
-                   @page-change="pageChange"></avue-notice>
+                   @click="goUrl"
+                   @page-change="pageChange">
+      </avue-notice>
     </el-scrollbar>
     <div slot="reference">
       <el-badge  :value="badge">
-        <i class="el-icon-bell"></i>
+        <i class="el-icon-bell" @click="init"></i>
       </el-badge>
     </div>
   </el-popover>
 </template>
 
 <script>
+  import { getMsgLogs , getMsgDetail,getMessage } from "@/api/logs";
 export default {
   name: "top-notice",
   data () {
@@ -30,14 +33,14 @@ export default {
       option: {
         props: {
           img: 'img',
-          title: 'title',
-          subtitle: 'subtitle',
+          title: 'messageBody',
+          subtitle: 'createTime',
           tag: 'tag',
-          status: 'status'
+          status: 'messageType'
         },
       },
       data: [],
-      path:"ws://192.168.1.151:8104/websocket?user=1",
+      path:"",
       socket:"",
       badge:''
     }
@@ -46,11 +49,21 @@ export default {
     // this.webSocket();
   },
   mounted() {
+    //60秒轮训消息
+    window.setInterval(() => {
+      setTimeout(() => {
+        this.assistMessage()
+      },0)
+    },60000)
+    this.path = "wss://trade.tubaosoft.com/api/blade-client/websocket?user=" + this.$store.getters.userInfo.user_id
      this.init();
   },
   methods: {
     //初始化
     init(){
+      getMsgLogs().then(res=>{
+        this.afterData(res.data.data.records)
+      })
       if(typeof(WebSocket) === "undefined"){
         alert("您的浏览器不支持socket")
       }else{
@@ -62,25 +75,23 @@ export default {
         this.socket.onerror = this.error
         // 监听socket消息
         this.socket.onmessage = this.getMessage
+        this.assistMessage()
       }
     },
     open() {
       console.log("socket连接成功")
-      console.log()
     },
     error() {
       console.log("连接错误")
     },
     getMessage(msg){
-      console.log(msg.data)
-
-      // let msgData =  JSON.stringify(msg.data);
-      // console.log(msgData)
-      // if(msg.data.unRead){
-      //   this.badge = msg.data.unReadNum
-      // }else{
-      //   this.badge = ''
-      // }
+      let msgData = JSON.parse(msg);
+      console.log(msgData.data.unRead)
+      if(msgData.data.unRead){
+        this.badge = msgData.data.unReadNum
+      }else{
+        this.badge = ''
+      }
     },
     send() {
       // this.socket.send(params)
@@ -88,13 +99,38 @@ export default {
     close() {
       console.log("socket已经关闭")
     },
-
+    assistMessage(){
+      //辅助消息接口
+      getMessage().then(res=>{
+        this.getMessage(JSON.stringify(res))
+      })
+    },
+    goUrl(row){
+      if(row.url){
+        this.$router.push({
+          path: row.url,
+          query: {params:row.parameter},
+        });
+      }
+      getMsgDetail(row.id).then(res=>{
+        this.$set(row,"isRead",res.data.data.isRead)
+        this.afterData(this.data)
+        this.assistMessage()
+      })
+    },
+    afterData(data){
+      this.data = data.map(item =>{
+        if(item.isRead == 0){
+          item.tag = "未读"
+          item.messageType = 1//状态  0 灰色  1 蓝色 2 橙色 3 红色 4 绿色
+        }else{
+          item.tag = "已读"
+          item.messageType = 0
+        }
+        return item
+      })
+    },
     pageChange (page, done) {
-      setTimeout(() => {
-        this.$message.success('页码' + page)
-        this.data = this.data.concat(list);
-        done();
-      }, 1000)
 
     },
   }
@@ -102,4 +138,7 @@ export default {
 </script>
 
 <style lang="scss" scoped>
+  ::v-deep .avue-notice__more {
+    display: none;
+  }
 </style>

+ 1 - 0
src/views/purchase/contract/detailsPage.vue

@@ -291,6 +291,7 @@
           ref="feeInfo"
           :orderFeesList="orderFeesList"
           :disabled="viewDisabled"
+          :optionType="'JK'"
           @beforeFinance="beforeFinance"
           feeUrl=""
         />

+ 5 - 5
src/views/report/reportlist.vue

@@ -119,11 +119,11 @@ export default {
       return ids.join(",");
     }
   },
-  filters: {
-    nameFormat(name) {
-      return nameReportFormat(name);
-    }
-  },
+  // filters: {
+  //   nameFormat(name) {
+  //     return nameReportFormat(name);
+  //   }
+  // },
   methods: {
     handlePreview(name) {
       this.$router.push({

+ 6 - 4
src/views/workManagement/main-items/list.vue

@@ -49,8 +49,9 @@
         <el-button size="small"
                    icon="el-icon-printer"
                    type="info"
+                   :loading="exportLoading"
                    @click.stop="openReport()"
-          >报表
+          >导 出
         </el-button>
       </template>
       <template slot-scope="scope" slot="menu">
@@ -94,6 +95,7 @@ export default {
   data() {
     return {
       loading: false,
+      exportLoading:false,
       data: [],
       options:[],
       show: true,
@@ -123,7 +125,6 @@ export default {
         itemId:this.$route.query.itemId
       }
       this.show = false;
-      this.$store.commit("MAIN_IN_DETAIL");
     }
     getUserList().then(res=>{
       res.data.data.map((item,index)=>{
@@ -152,6 +153,7 @@ export default {
     },
     //报表
     openReport() {
+      this.exportLoading = true
       let  searchParams = Object.assign({},this.search);
       let param = this.paramsAdjustment(searchParams)
       getList(1, 10000,param).then(res =>{
@@ -164,6 +166,8 @@ export default {
           columns: option.column,
           data: fileData,
         });
+      }).finally(()=>{
+        this.exportLoading = false
       })
     },
 
@@ -198,7 +202,6 @@ export default {
         id: '',
       };
       this.show = false;
-      this.$store.commit("MAIN_IN_DETAIL");
     },
     //编辑打开
     editOpen(row, index){
@@ -206,7 +209,6 @@ export default {
         id: row.id
       };
       this.show = false;
-      this.$store.commit("MAIN_IN_DETAIL");
     },
     searchChange(params, done) {
       this.getList(this.page, params);

+ 9 - 1
src/views/workManagement/receipt/settleAccounts.vue

@@ -45,8 +45,9 @@
           icon="el-icon-printer"
           size="small"
           type="primary"
+          :loading="exportLoading"
           @click.stop="downFile"
-        >报 表
+        >导 出
         </el-button>
       </template>
       <template slot-scope="scope" slot="menu">
@@ -80,6 +81,7 @@
       return {
         loading: false,
         show:true,
+        exportLoading:false,
         detailData:{},
         data: [],
         options:[],
@@ -106,6 +108,7 @@
       detailPage
     },
     created() {
+
       if(this.$route.query.itemId){
         this.detailData={
           itemId:this.$route.query.itemId
@@ -113,6 +116,8 @@
         this.show = false;
         this.$store.commit("MAIN_IN_DETAIL");
       }
+
+      //模糊提前查20条数据
       getUserList().then(res=>{
         res.data.data.map((item,index)=>{
           if(index <= 20){
@@ -126,6 +131,7 @@
     },
     methods: {
       downFile(){
+        this.exportLoading = true
         let  searchParams = Object.assign({},this.search);
         let param = this.paramsAdjustment(searchParams)
 
@@ -139,6 +145,8 @@
             columns: option.column,
             data: fileData,
           });
+        }).finally(()=>{
+          this.exportLoading = false
         })
       },
       //远程模糊

+ 9 - 5
src/views/workManagement/receipt/settleAccountsDetailsPage.vue

@@ -465,12 +465,16 @@
       }
     },
     created() {
-      this.id = this.detailData.id;
-      this.getProjectDetail();
-      const params = {
-        code : "affair_payment_term"
+      if(this.detailData.id){
+        this.id = this.detailData.id;
+      }
+      if(this.detailData.itemId){
+        this.id = this.detailData.itemId;
       }
-      getDictionary(params).then(res =>{
+      this.getProjectDetail();
+
+      //收款方式
+      getDictionary({code : "affair_payment_term"}).then(res =>{
         this.paymentTerm = res.data.data;
       })
     },

+ 27 - 6
src/views/workManagement/receipt/statisticalList.vue

@@ -19,8 +19,9 @@
           icon="el-icon-printer"
           size="small"
           type="primary"
+          :loading="exportLoading"
           @click.stop="downFile"
-        >报 表
+        >导 出
         </el-button>
       </template>
       <template slot="cornIdSearch">
@@ -59,24 +60,36 @@
         </el-button>
       </template>
     </avue-crud>
+    <report-dialog
+      :switchDialog="switchDialog"
+      :reportId="form.id"
+      reportName="统计列表"
+      @onClose="onClose()"
+    ></report-dialog>
   </basic-container>
 </template>
 
 <script>
   import option from "./configuration/statisticalList.json";
+  import reportDialog from "@/components/report-dialog/main";
   import { getFlowList,getUserList } from "@/api/workManagement/mainProject";
 
   export default {
     name: "statisticalList",
+    components:{
+      reportDialog
+    },
     data() {
       return {
         loading:false,
         form: {},
         search:{},
+        exportLoading:false,
         option: option,
         parentId:0,
         dataList: [],
         options:[],
+        switchDialog:false,
         page: {
           currentPage: 1,
           total: 0,
@@ -108,10 +121,16 @@
       // option.height = window.innerHeight - 320 ;
     },
     methods: {
+
+      onClose(val) {
+        this.switchDialog = val;
+      },
+
       downFile(){
+        this.exportLoading = true
         let  searchParams = Object.assign({},this.search);
         let param = this.paramsAdjustment(searchParams)
-        getFlowList(1, 10000,param).then(res =>{
+        getFlowList(1, -1,param).then(res =>{
           const fileData = this.deepClone(res.data.data.records)
           fileData.map(item =>{
             item.cornId = item.cornName
@@ -131,6 +150,8 @@
             columns: option.column,
             data: fileData,
           });
+        }).finally(()=>{
+          this.exportLoading = false
         })
       },
       rowDel() {
@@ -154,7 +175,7 @@
       },
       check(row,index){
         if(this.$store.getters.mainItemStatus){
-          this.$alert("主营项目页面已存在,请关闭主营项目再进行操作", "温馨提示", {
+          this.$alert("结算页面已存在,请关闭结算页面再进行操作", "温馨提示", {
             confirmButtonText: "确定",
             type: 'warning',
             callback: action => {
@@ -163,10 +184,10 @@
         }else{
           //关闭一下存在的列表页
           ///workManagement/receipt/settleAccounts
-          this.$router.$avueRouter.closeTag('/workManagement/main-items/list');
+          this.$router.$avueRouter.closeTag('/workManagement/receipt/settleAccounts');
           this.$router.push({
-            path: "/workManagement/main-items/list",
-            query: {itemId: row.id},
+            path: "/workManagement/receipt/settleAccounts",
+            query: {itemId: row.pid},
           });
         }
       },

+ 137 - 3
src/views/workManagement/task/index.vue

@@ -28,8 +28,9 @@
           icon="el-icon-printer"
           size="small"
           type="primary"
+          :loading="exportLoading"
           @click.stop="downFile"
-        >报 表
+        >导 出
         </el-button>
       </template>
       <template slot-scope="scope" slot="menu">
@@ -37,7 +38,7 @@
           type="text"
           icon="el-icon-view"
           size="small"
-          @click.stop=""
+          @click.stop="copyTo"
         >发送
         </el-button>
         <el-button
@@ -50,6 +51,40 @@
         </el-button>
       </template>
     </avue-crud>
+    <el-dialog
+      append-to-body
+      title="消息"
+      class="el-dialogDeep"
+      :visible.sync="copyToDialog"
+      width="60%"
+      :close-on-click-modal="false"
+      :destroy-on-close="true"
+      :close-on-press-escape="false"
+      v-dialog-drag
+    >
+      <avue-form class="trading-form" :option="optionMeg" ref="formMeg" v-model="formMeg">
+        <template slot="toUserId">
+          <el-select v-model="formMeg.toUserId"
+                     remote
+                     filterable
+                     clearable
+                     @change="toUserChange"
+                     :remote-method="remoteMethod"
+          >
+            <el-option
+              v-for="item in userOption"
+              :key="item.value"
+              :label="item.realName"
+              :value="item.id">
+            </el-option>
+          </el-select>
+        </template>
+      </avue-form>
+      <div style="margin-left: 80%;padding: 10px">
+        <el-button size="small" @click="copyToDialog = false">取消</el-button>
+        <el-button type="primary" size="small" @click="submitCopy()">确定</el-button>
+      </div>
+    </el-dialog>
   </basic-container>
 </template>
 
@@ -57,11 +92,15 @@
   import option from "./configuration/mainList.json";
   import { getFlowList } from "@/api/workManagement/mainProject";
   import { updateItemStatus } from "@/api/workManagement/mainProject";
+  import { getUserList } from "@/api/workManagement/mainProject";
+  import { saveMessage } from "@/api/logs";
   export default {
     name: "customerInformation",
     data() {
       return {
         loading : false,
+        exportLoading:false,
+        copyToDialog:false,
         form: {},
         search:{},
         configuration:{
@@ -82,17 +121,110 @@
           total: 0,
           pageSize: 10
         },
-        query:{}
+        query:{},
+        userOption:[],
+        optionMeg:{
+          emptyBtn: false,
+          submitBtn: false,
+          labelWidth: 120,
+          menuSpan: 8,
+          column: [
+            {
+              label: '抄送人',
+              prop: 'toUserId',
+              span: 12,
+              type:'select',
+              rules: [
+                {
+                  required: true,
+                  message: ' ',
+                  trigger: 'blur'
+                }
+              ]
+            },
+            {
+              label: '抄送日期',
+              prop: 'createTime',
+              type: "datetime",
+              span: 12,
+              disabled:true,
+              rules: [
+                {
+                  required: false,
+                  message: ' ',
+                  trigger: 'blur'
+                }
+              ]
+            },
+            {
+              label: '内容',
+              prop: 'messageBody',
+              span: 24,
+              rules: [
+                {
+                  required: true,
+                  message: ' ',
+                  trigger: 'blur'
+                }
+              ]
+            }
+          ]
+        },
+        formMeg:{}
       }
     },
     created() {
 
     },
     mounted() {
+      getUserList().then(res=>{
+        res.data.data.map((item,index)=>{
+          if(index <= 20){
+            this.userOption.push(item)
+          }
+        })
+      })
       // option.height = window.innerHeight - 350 ;
     },
     methods: {
+      //抄送
+      copyTo(){
+        this.formMeg = {}
+        this.copyToDialog = true;
+        let date = new Date();
+        let strDate = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
+        this.$set(this.formMeg,"createTime",strDate)
+      },
+      //用户远程模糊
+      remoteMethod(query){
+        let params = {
+          realName : query
+        }
+        getUserList(params).then(res=>{
+          this.userOption = res.data.data
+        })
+      },
+      toUserChange(value){
+        this.userOption.forEach(item =>{
+          if(item.id == value){
+            this.formMeg.toUserName = item.realName
+          }
+        })
+      },
+      submitCopy(){
+        this.$refs["formMeg"].validate((valid) => {
+          if(valid){
+            saveMessage(this.formMeg).then(res=>{
+              if(res.data.success){
+                this.$message.success("抄送成功!")
+                this.copyToDialog = false
+              }
+            })
+          }
+        })
+      },
       downFile(){
+        this.exportLoading = true
         let searchParams = Object.assign({},this.search);
         let param = this.paramsAdjustment(searchParams)
         getFlowList(1, 10000,param).then(res =>{
@@ -107,6 +239,8 @@
             columns: fileColumn,
             data: fileData,
           });
+        }).finally(()=>{
+          this.exportLoading = false
         })
       },
       //完工