lilei 2 лет назад
Родитель
Сommit
4d3d926c5f

+ 1 - 1
.env.development

@@ -1,7 +1,7 @@
 NODE_ENV=development
 VUE_APP_PREVIEW=true
 VUE_APP_API_BASE_URL=/api
-VUE_APP_WX_BASE_URL=//192.168.16.103:8503/qpls-md/websocket/
+VUE_APP_WX_BASE_URL=//192.168.0.103:8503/qpls-md/websocket/
 VUE_APP_VERSION=V1.0.1
 VUE_APP_ENVTIPS=开发环境(仅供测试)
 VUE_APP_PRO_NAME=iSCM智慧供应链系统

+ 1 - 1
public/version.json

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

+ 122 - 25
src/layouts/BasicLayout.vue

@@ -46,6 +46,33 @@
         </transition>
       </a-layout-content>
 
+      <!-- 消息通知 -->
+      <div class="notes-box" v-if="notesList.length">
+        <div v-for="item in notesList" :key="item.id">
+          <!-- <a-alert type="warning" showIcon closable>
+            <div slot="description">
+              【急送提醒】成美汽配发来一条急送需求 <a-button size="small" type="link" class="button-info">点击查看</a-button>
+            </div>
+          </a-alert>
+          <a-alert type="info" showIcon closable>
+            <div slot="description">
+              【补货提醒】成美汽配发来一条急送需求 <a-button size="small" type="link" class="button-info">点击查看</a-button>
+            </div>
+          </a-alert>
+          <a-alert type="info" showIcon closable>
+            <div slot="description">
+              【订单提醒】成美汽配发来一条急送需求 <a-button size="small" type="link" class="button-info">点击查看</a-button>
+            </div>
+          </a-alert>
+          <a-alert type="error" showIcon closable>
+            <div slot="description">
+              【货架异常提醒】成美汽配发来一条急送需求 <a-button size="small" type="link" class="button-info">点击查看</a-button>
+            </div>
+          </a-alert> -->
+        </div>
+        <div class="notes-more">更多消息>></div>
+      </div>
+
       <!-- 视频播放弹窗 -->
       <div v-if="isShowVideoVal">
         <a-modal
@@ -101,8 +128,8 @@ export default {
   mixins: [mixin, mixinDevice, commonMixin],
   provide () {
     return {
-      reloadView: this.reloadView,
-      setIsHomeNav: this.setIsHomeNav
+      setIsHomeNav: this.setIsHomeNav,
+      reloadView: this.reloadView
     }
   },
   components: {
@@ -121,7 +148,8 @@ export default {
       menus: [],
       isRouterAlive: true,
       showPdfView: false,
-      showSelectPrint: false
+      showSelectPrint: false,
+      notesList: []
     }
   },
   computed: {
@@ -132,13 +160,12 @@ export default {
       fixedHeader: state => state.app.fixedHeader
     }),
     ...mapGetters(['nowRoute', 'isShowVideo']),
-    isShowVideoVal: {
-      get () {
-        return this.$store.state.app.isShowVideo
-      },
-      set (newValue) {
-        this.$store.state.app.isShowVideo = newValue
-      }
+    isShowVideoVal () {
+      return this.$store.state.app.isShowVideo
+    },
+    // 接受到ws消息
+    wsMessage () {
+      return this.$store.getters.wsMessageData()
     },
     contentPaddingLeft () {
       if (!this.fixSidebar || this.isMobile()) {
@@ -173,20 +200,20 @@ export default {
           fullscreenToggle: true // 全屏按钮
         }
       }
-      const isSaleOrder = this.nowRoute.indexOf('salesQuery') > -1 // 当前展示是否为销售单模块
-      const isSalesReturn = this.nowRoute.indexOf('salesReturn') > -1 // 当前展示是否为销售退货模块
-      const isPurchaseOrder = this.nowRoute.indexOf('purchaseOrder') > -1 // 当前展示是否为采购单管理模块
-      const isPurchaseReturn = this.nowRoute.indexOf('purchaseReturn') > -1 // 当前展示是否为采购退货模块
-      if (isSaleOrder) {
+      // 当前展示是否为销售单模块
+      if (this.nowRoute.indexOf('salesQuery') > -1) {
         playerOptions.sources[0].src = 'https://jianguan-images.oss-cn-beijing.aliyuncs.com/helpvideo/1xiaoshou.mp4'
       }
-      if (isSalesReturn) {
+      // 当前展示是否为销售退货模块
+      if (this.nowRoute.indexOf('salesReturn') > -1) {
         playerOptions.sources[0].src = 'https://jianguan-images.oss-cn-beijing.aliyuncs.com/helpvideo/2xiaoshoutuihuo.mp4'
       }
-      if (isPurchaseOrder) {
+      // 当前展示是否为采购单管理模块
+      if (this.nowRoute.indexOf('purchaseOrder') > -1) {
         playerOptions.sources[0].src = 'https://jianguan-images.oss-cn-beijing.aliyuncs.com/helpvideo/3caigou.mp4'
       }
-      if (isPurchaseReturn) {
+      // 当前展示是否为采购退货模块
+      if (this.nowRoute.indexOf('purchaseReturn') > -1) {
         playerOptions.sources[0].src = 'https://jianguan-images.oss-cn-beijing.aliyuncs.com/helpvideo/4caigoutuihuo.mp4'
       }
 	    return playerOptions
@@ -196,8 +223,17 @@ export default {
     sidebarOpened (val) {
       this.collapsed = !val
     },
+    // 监听ws消息通知
+    wsMessage (a, b) {
+      if (a !== b && a) {
+        // 新未读消息
+        if (a.type == 'no_read_count') {
+          this.getNotes()
+        }
+      }
+    },
+    // 打印预览
     '$store.state.app.showPdfPrintView' (newValue, oldValue) {
-      console.log(newValue)
       if (newValue) {
         this.showPdfView = newValue
         this.$nextTick(() => {
@@ -205,8 +241,8 @@ export default {
         })
       }
     },
+    // 选择打印机
     '$store.state.app.showSelectPrint' (newValue, oldValue) {
-      console.log(newValue)
       if (newValue) {
         this.showSelectPrint = newValue
       }
@@ -220,12 +256,14 @@ export default {
       const noqx = asyncRouterMap.find((item) => item.path === '/').children
       this.menus = [noqx.find(item => item.path === '/home')]
     }
+
     // 重置主题,字体,布局
     this.collapsed = !this.sidebarOpened
     this.$store.dispatch('ToggleMultiTab', true)
     this.$store.dispatch('ToggleColor', '#2A86F4')
     this.$store.dispatch('ToggleTheme', localStorage.getItem('DEFAULT_THEME') || 'dark')
     this.$store.dispatch('ToggleFontSize', localStorage.getItem('DEFAULT_FONT_SIZE') || 'small')
+
     // 判断是否是当月25日后
     this.$store.state.app.isLastDayForMonth = moment().date() >= 25
     if (this.$store.state.app.isLastDayForMonth && this.$hasPermissions('M_mothEndTips')) {
@@ -242,6 +280,9 @@ export default {
     this.$store.commit('SET_printLoading', false)
     this.$store.commit('SET_printDefNeedle', localStorage.getItem('DEFAULT_PRINT_NEEDLE') || undefined)
     this.$store.commit('SET_printDefInk', localStorage.getItem('DEFAULT_PRINT_INK') || undefined)
+
+    // 消息通知
+    this.getNotes()
   },
   mounted () {
     const userAgent = navigator.userAgent
@@ -255,7 +296,12 @@ export default {
     }
   },
   methods: {
-    ...mapActions(['setSidebar']),
+    ...mapActions([
+      'setSidebar',
+      'getMessageList', // 查询列表
+      'hasRead' // 设置已读
+    ]),
+    reloadView () {},
     // 关闭视频弹窗
     closeVido () {
       store.commit('IS_ShOW_VIDEO', false)
@@ -279,10 +325,30 @@ export default {
     drawerClose () {
       this.collapsed = false
     },
-    reloadView () {
-      this.isRouterAlive = false
-      this.$nextTick(() => {
-        this.isRouterAlive = true
+    // 获取最新消息
+    getNotes () {
+      this.getMessageList({
+        pageNo: 1,
+        pageSize: 5,
+        notice: {
+          type: 'tx'
+        },
+        readFlag: 0
+      }).then((res) => {
+        if (res.status == 200) {
+          this.notesList = res.data.list
+        } else {
+          this.notesList = []
+        }
+      })
+    },
+    // 设置已读
+    setRead (row) {
+      this.hasRead({ msg_id: row.id }).then(res => {
+        // 刷新列表
+        if (res.status == 200) {
+
+        }
       })
     }
   }
@@ -291,4 +357,35 @@ export default {
 
 <style lang="less">
 @import url('../components/global.less');
+.notes-box{
+  position:fixed;
+  right:0;
+  bottom:0;
+  min-width:400px;
+  z-index: 10000;
+  .ant-alert-with-description .ant-alert-close-icon{
+    top: 13px;
+  }
+  .ant-alert, .ant-alert-info{
+    padding: 10px 30px!important;
+  }
+  .ant-alert .ant-alert-icon, .ant-alert-info .ant-alert-icon{
+    top: 16px !important;
+    left: 10px !important;
+    font-size: 18px;
+  }
+  .ant-alert-with-description .ant-alert-description{
+    font-size: 14px;
+  }
+  .notes-more{
+    padding: 10px;
+    text-align:center;
+    color:#00aaff;
+    font-size: 14px;
+    cursor:pointer;
+    background: #fff;
+    border: 1px solid #eee;
+    border-radius: 5px 5px 0 0;
+  }
+}
 </style>

+ 89 - 11
src/views/notice/list.vue

@@ -4,17 +4,38 @@
     <div ref="tableSearch" class="table-page-search-wrapper">
       <a-form layout="inline" @keyup.enter.native="handelSearch(1)">
         <a-row :gutter="15">
-          <a-col :md="6" :sm="24">
+          <a-col :md="8" :sm="24">
             <a-form-item label="发布时间">
               <rangeDate ref="rangeDate" @change="dateChange" />
             </a-form-item>
           </a-col>
-          <a-col :md="6" :sm="24">
+          <a-col :md="8" :sm="24">
             <a-form-item label="标题">
-              <a-input id="noticeList-title" v-model.trim="queryParam.notice.title" allowClear placeholder="请输入标题"/>
+              <a-input v-model.trim="queryParam.notice.title" allowClear placeholder="请输入标题"/>
             </a-form-item>
           </a-col>
-          <a-col :md="6" :sm="24">
+          <a-col :md="8" :sm="24">
+            <a-form-item label="类型">
+              <a-select v-model.trim="queryParam.notice.type" allowClear placeholder="请选择类型">
+                <a-select-option v-for="item in typeList" :key="item.val" :value="item.val">
+                  {{ item.text }}
+                </a-select-option>
+              </a-select>
+            </a-form-item>
+          </a-col>
+          <a-col :md="8" :sm="24">
+            <a-form-item label="状态">
+              <a-select v-model.trim="queryParam.readFlag" allowClear placeholder="请选择状态">
+                <a-select-option value="0">
+                  未读
+                </a-select-option>
+                <a-select-option value="1">
+                  已读
+                </a-select-option>
+              </a-select>
+            </a-form-item>
+          </a-col>
+          <a-col :md="8" :sm="24">
             <a-button type="primary" @click="handelSearch(1)" :disabled="disabled" id="noticeList-refresh">查询</a-button>
             <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="noticeList-reset">重置</a-button>
           </a-col>
@@ -36,9 +57,20 @@
       <!-- 操作 -->
       <template slot="action" slot-scope="text, record">
         <a-badge :count="record.readFlag=='0'? 1 : 0" dot>
-          <a-button size="small" type="link" class="button-success" @click="handleDetail(record)" id="noticeList-detail-btn">详情</a-button>
+          <a-button size="small" type="link" class="button-success" @click="handleDetail(record)">详情</a-button>
         </a-badge>
       </template>
+      <!-- type-->
+      <template slot="type" slot-scope="text, record">
+        {{ text?typeList.find(item => item.val == text).text:'--' }}
+      </template>
+      <!-- 内容 content-->
+      <template slot="content" slot-scope="text, record">
+        {{ text?text.slice(0,30)+(text.length>30?'...':''):'--' }}
+        <a-button v-if="record.notice.type=='tx'" @click="toAction(record)" size="small" type="link" class="button-info">
+          {{ record.notice.extInfo.bizType == 'SHELF_REPLENISH' ? '立即处理':'点击查看' }}
+        </a-button>
+      </template>
     </a-table>
     <!-- 分页 -->
     <tablePagination
@@ -69,8 +101,10 @@ export default {
       queryParam: { //  查询条件
         beginDate: '',
         endDate: '',
+        readFlag: undefined,
         notice: {
-          title: ''
+          title: '',
+          type: undefined
         }
       },
       tableHeight: 0,
@@ -78,9 +112,9 @@ export default {
       columns: [
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
         { title: '发布时间', dataIndex: 'createDate', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '类别', dataIndex: 'notice.title', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '类别', dataIndex: 'notice.type', scopedSlots: { customRender: 'type' }, width: '15%', align: 'center' },
         { title: '标题', dataIndex: 'notice.title', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '内容', dataIndex: 'notice.title', width: '35%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '内容', dataIndex: 'notice.plainContent', scopedSlots: { customRender: 'content' }, width: '35%', align: 'center' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '15%', align: 'center' }
       ],
       loadData: [],
@@ -91,7 +125,25 @@ export default {
       },
       listLoading: false,
       openModal: false, //  查看客户详情  弹框
-      itemId: '' //  当前id
+      itemId: '', //  当前id
+      typeList: [
+        {
+          text: '公告',
+          val: 'notity'
+        },
+        {
+          text: '企业新闻',
+          val: 'news_company'
+        },
+        {
+          text: '行业咨询',
+          val: 'news_trade'
+        },
+        {
+          text: '提醒',
+          val: 'tx'
+        }
+      ]
     }
   },
   computed: {
@@ -110,6 +162,24 @@ export default {
       this.queryParam.beginDate = date[0] ? date[0] : ''
       this.queryParam.endDate = date[1] ? date[1] : ''
     },
+    toAction (data) {
+      // 急送订单
+      if (data.notice.extInfo.bizType == 'TEMP_ORDER') {
+        this.$router.push({ name: 'salesDetail', params: { sn: data.notice.extInfo.bizSn } })
+      }
+      // 补货订单
+      if (data.notice.extInfo.bizType == 'SHELF_REPLENISH') {
+        this.$router.push({ name: 'replenishmentManagement', query: { bizType: 'WAIT_CONFIRM' } })
+      }
+      // 货架订单
+      if (data.notice.extInfo.bizType == 'SHELF_ORDER') {
+        this.$router.push({ name: 'shelfOrderDetail', params: { sn: data.notice.extInfo.bizSn } })
+      }
+      // 货架异常
+      if (data.notice.extInfo.bizType == 'SHELF_WARN') {
+        this.$router.push({ name: 'shelfOrderList', query: { shelfSn: data.notice.extInfo.bizSn } })
+      }
+    },
     // 查询列表
     handelSearch (pageNo) {
       this.paginationProps.current = pageNo || this.paginationProps.current
@@ -117,8 +187,10 @@ export default {
       const params = {
         pageNo: this.paginationProps.current,
         pageSize: this.paginationProps.pageSize,
+        readFlag: this.queryParam.readFlag,
         notice: {
-          title: this.queryParam.notice.title
+          title: this.queryParam.notice.title,
+          type: this.queryParam.notice.type
         },
         beginDate: this.queryParam.beginDate,
         endDate: this.queryParam.endDate
@@ -134,8 +206,12 @@ export default {
           const no = (data.pageNo - 1) * data.pageSize
           for (var i = 0; i < data.list.length; i++) {
             data.list[i].no = no + i + 1
+            if (data.list[i].notice.extInfo) {
+              data.list[i].notice.extInfo = JSON.parse(data.list[i].notice.extInfo)
+            }
           }
           this.loadData = data.list
+          console.log(this.loadData)
           this.disabled = false
         } else {
           this.paginationProps.total = 0
@@ -165,7 +241,9 @@ export default {
       this.$refs.rangeDate.resetDate()
       this.queryParam.beginDate = ''
       this.queryParam.endDate = ''
+      this.queryParam.readFlag = undefined
       this.queryParam.notice.title = undefined
+      this.queryParam.notice.type = undefined
       this.paginationProps.total = 0
       this.paginationProps.current = 1
       this.paginationProps.pageSize = 20
@@ -198,7 +276,7 @@ export default {
     },
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
-      this.tableHeight = window.innerHeight - tableSearchH - 210
+      this.tableHeight = window.innerHeight - tableSearchH - 240
     }
   },
   watch: {

+ 18 - 11
src/views/numsGoodsShelves/replenishmentManagement/printStickerModal.vue

@@ -31,13 +31,13 @@
         <!-- 打印数量 -->
         <template slot="printQty" slot-scope="text, record">
           <a-input-number
-            v-if="record.confirmQty&&record.confirmQty!=0"
+            v-if="record.maxQty&&record.maxQty!=0"
             size="small"
             id="replenishmentManagement-printSticker-printQty"
             v-model="record.printQty"
             :precision="0"
             :min="1"
-            :max="record.confirmQty"
+            :max="record.maxQty"
             placeholder="请输入"
             style="width: 100%" />
           <span v-else>--</span>
@@ -80,14 +80,6 @@ export default {
       spinning: false,
       isShow: this.openModal, //  是否打开弹框
       showView: false,
-      columns: [
-        { title: '产品编码', dataIndex: 'product.code', width: '22%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'product.name', width: '30%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '补货应发数量', dataIndex: 'qty', width: '13%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '实发数量', dataIndex: 'confirmQty', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '打印数量', scopedSlots: { customRender: 'printQty' }, width: '15%', align: 'center' },
-        { title: '单位', dataIndex: 'product.unit', width: '8%', align: 'center', customRender: function (text) { return text || '--' } }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -98,7 +90,8 @@ export default {
             data = res.data
             for (var i = 0; i < data.length; i++) {
               data[i].no = i + 1
-              data[i].printQty = data[i].confirmQty
+              data[i].maxQty = data[i].billState == 'FINISH' ? data[i].putQty : data[i].confirmQty
+              data[i].printQty = data[i].billState == 'FINISH' ? data[i].putQty : data[i].confirmQty
             }
             this.disabled = false
             this.listData = data || []
@@ -116,6 +109,20 @@ export default {
     modalTit () {
       const hjName = this.nowData && this.nowData.shelfInfo.shelfName ? this.nowData.shelfInfo.shelfName : ''
       return '补货单打印贴签——' + hjName
+    },
+    columns () {
+      const ret = [
+        { title: '产品编码', dataIndex: 'product.code', width: '22%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'product.name', width: '30%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '补货应发数量', dataIndex: 'qty', width: '13%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '实发数量', dataIndex: 'confirmQty', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '打印数量', scopedSlots: { customRender: 'printQty' }, width: '15%', align: 'center' },
+        { title: '单位', dataIndex: 'product.unit', width: '8%', align: 'center', customRender: function (text) { return text || '--' } }
+      ]
+      if (this.basicInfoData && this.basicInfoData.billState == 'FINISH') {
+        ret.splice(4, 0, { title: '签收数量', dataIndex: 'putQty', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return ret
     }
   },
   methods: {

+ 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.115:8503/qpls-md',
+        // target: 'http://192.168.0.103:8503/qpls-md',
         target: 'http://p.iscm.360arrow.com/qpls-md',
         // ws: false,
         ws: true,