Explorar el Código

消息管理设置

lilei hace 2 años
padre
commit
dcdf497505

+ 1 - 1
public/version.json

@@ -1,5 +1,5 @@
 {
   "message": "发现有新版本发布,确定更新系统?",
   "vendorJsVersion": "",
-  "version": 1663654281807
+  "version": 1663661689027
 }

+ 17 - 0
src/api/noticeUser.js

@@ -34,3 +34,20 @@ export const hasRead = id => {
     method: 'get'
   })
 }
+ // 消息公共权限设置列表
+export const noticeUserBizQuery = (params) => {
+  const url = `/noticeUserBiz/query`
+  return axios({
+    url: url,
+    method: 'get'
+  })
+}
+// 消息公共权限保存
+export const noticeUserBizSave = (params) => {
+  const url = `/noticeUserBiz/save`
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}

+ 26 - 1
src/config/router.config.js

@@ -442,7 +442,7 @@ export const asyncRouterMap = [
             meta: {
               title: '货架订单',
               icon: 'monitor',
-              // permission: 'M_shelfOrder'
+              permission: 'M_shelfOrder'
             },
             hideChildrenInMenu: true,
             children: [
@@ -3031,6 +3031,31 @@ export const asyncRouterMap = [
                 }
               }
             ]
+          },
+          {
+            path: '/basicData/notificationManage',
+            redirect: '/basicData/notificationManage/list',
+            name: 'notificationManage',
+            component: BlankLayout,
+            meta: {
+              title: '消息提醒管理',
+              icon: 'sound',
+              // permission: 'M_notificationManageList'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'notificationManageList',
+                component: () => import(/* webpackChunkName: "basicData" */ '@/views/basicData/notificationManage/list.vue'),
+                meta: {
+                  title: '消息提醒管理',
+                  icon: 'sound',
+                  hidden: true,
+                  // permission: 'M_notificationManageList'
+                }
+              }
+            ]
           }
         ]
       },

+ 157 - 0
src/views/basicData/notificationManage/list.vue

@@ -0,0 +1,157 @@
+<template>
+  <a-card size="small" :bordered="false" class="customerTypeList-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div ref="tableSearch" class="table-page-search-wrapper"></div>
+      <!-- 列表 -->
+      <a-table
+        class="sTable fixPagination"
+        ref="table"
+        :style="{ height: tableHeight+84.5+'px' }"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data-source="loadData"
+        :scroll="{ y: tableHeight }"
+        bordered>
+        <!-- 操作 -->
+        <template slot="action1" slot-scope="text, record, index">
+          <a-checkbox :checked="text==1" @change="onChange(0,record)"></a-checkbox>
+        </template>
+        <template slot="action2" slot-scope="text, record, index">
+          <a-checkbox :checked="text==1" @change="onChange(1,record)"></a-checkbox>
+        </template>
+        <template slot="action3" slot-scope="text, record, index">
+          <a-checkbox :checked="text==1" @change="onChange(2,record)"></a-checkbox>
+        </template>
+        <template slot="action4" slot-scope="text, record, index">
+          <a-checkbox :checked="text==1" @change="onChange(3,record)"></a-checkbox>
+        </template>
+        <template slot="action5" slot-scope="text, record, index">
+          <a-checkbox :checked="text==1" @change="onChange(4,record)"></a-checkbox>
+        </template>
+      </a-table>
+    </a-spin>
+  </a-card>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { noticeUserBizQuery, noticeUserBizSave } from '@/api/noticeUser'
+import { STable, VSelect } from '@/components'
+export default {
+  name: 'NotificationManageList',
+  components: { STable, VSelect },
+  mixins: [commonMixin],
+  data () {
+    return {
+      spinning: false,
+      tableHeight: 0,
+      disabled: false, //  查询、重置按钮是否可操作
+      columns: [
+        { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
+        { title: '用户名称', dataIndex: 'userName', width: '45%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '急送提醒', dataIndex: 'tempOrderFlag', scopedSlots: { customRender: 'action1' }, width: '10%', align: 'center' },
+        { title: '补货提醒', dataIndex: 'shelfReplenishFlag', scopedSlots: { customRender: 'action2' }, width: '10%', align: 'center' },
+        { title: '订单提醒', dataIndex: 'shelfOrderFlag', scopedSlots: { customRender: 'action3' }, width: '10%', align: 'center' },
+        { title: '货架异常提醒', dataIndex: 'shelfWarnFlag', scopedSlots: { customRender: 'action4' }, width: '10%', align: 'center' },
+        { title: '全选', dataIndex: 'allFlag', scopedSlots: { customRender: 'action5' }, width: '10%', align: 'center' }
+      ],
+      loadData: [],
+      openModal: false, //  新增编辑客户类型  弹框
+      itemId: '', //  当前id
+      nowData: null //  当前记录数据
+    }
+  },
+  methods: {
+    onChange (index, record) {
+      console.log(index, record)
+      const key = ['tempOrderFlag', 'shelfReplenishFlag', 'shelfOrderFlag', 'shelfWarnFlag', 'allFlag']
+      record[key[index]] = record[key[index]] ? 0 : 1
+      // 全选
+      if (index == 4) {
+        const flag = record[key[index]]
+        key.map(item => {
+          record[item] = flag ? 1 : 0
+        })
+      } else {
+        const ret = []
+        key.map(item => {
+          if (item != 'allFlag') {
+            ret.push(record[item])
+          }
+        })
+        record['allFlag'] = ret.filter(item => item == 1).length == 4 ? 1 : 0
+      }
+      // 保存数据
+      const noticeTypeList = []
+      const keys = ['temp_order', 'shelf_replenish', 'shelf_order', 'shelf_warn']
+      key.map((item, i) => {
+        if (item != 'allFlag' && record[item] == 1) {
+          noticeTypeList.push(keys[i])
+        }
+      })
+      this.spinning = true
+      noticeUserBizSave({
+        userSn: record.userSn,
+        noticeTypeList: noticeTypeList
+      }).then(res => {
+        if (res.status == 200) {
+          this.$message.success(res.message)
+        }
+        this.spinning = false
+        this.getData()
+      })
+    },
+    getData () {
+      this.spinning = true
+      noticeUserBizQuery().then(res => {
+        const data = res.data
+        if (res.status == 200) {
+          const no = 0
+          for (var i = 0; i < data.length; i++) {
+            data[i].no = no + i + 1
+            const key = ['tempOrderFlag', 'shelfReplenishFlag', 'shelfOrderFlag', 'shelfWarnFlag', 'allFlag']
+            const ret = []
+            key.map(item => {
+              if (data[i][item] == 1) {
+                ret.push(1)
+              }
+            })
+            data[i].allFlag = ret.length == 4 ? 1 : 0
+          }
+        }
+        this.loadData = data
+        this.spinning = false
+      })
+    },
+    pageInit () {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+      this.getData()
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 200
+    }
+  },
+  watch: {
+    '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
+      this.setTableH()
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.pageInit()
+    }
+  }
+}
+</script>

+ 1 - 1
vue.config.js

@@ -211,7 +211,7 @@ const vueConfig = {
     // If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
     proxy: {
       '/api': {
-        target: 'http://192.168.0.183:8503/qpls-md',
+        target: 'http://192.168.0.115:8503/qpls-md',
         // target: 'http://p.iscm.360arrow.com/qpls-md',
         // ws: false,
         ws: true,