Procházet zdrojové kódy

feat: 全局通知

zh před 2 roky
rodič
revize
3ed5bf2fa0

+ 10 - 1
src/api/dashboard.js

@@ -80,7 +80,7 @@ export function setMenuList(params) {
   })
 }
 
-// 常用菜单-列表
+// 物流通知列表
 export function getListInvoiceOrder(params) {
   return request({
     url: `/pick/listInvoiceOrder`,
@@ -88,3 +88,12 @@ export function getListInvoiceOrder(params) {
     params
   })
 }
+
+// 物流通知20秒拉取新消息
+export function getListInvoiceOrderTWO(params) {
+  return request({
+    url: `/pick/listInvoiceOrderTWO`,
+    method: 'get',
+    params
+  })
+}

+ 81 - 10
src/components/NotifyBox/index.vue

@@ -88,6 +88,50 @@
     </div>
     <!-- 物流通知 -->
     <div v-show="type === 3" class="table">
+      <el-form ref="invoiceOrderForm" :model="invoiceOrderForm" label-width="120px" label-position="left" size="mini">
+        <el-row :gutter="20">
+          <el-col :xs="24" :sm="12" :lg="8">
+            <el-form-item prop="invoiceId" label="发货单">
+              <el-input v-model="invoiceOrderForm.invoiceId" />
+            </el-form-item>
+          </el-col>
+          <el-col
+            :xs="24"
+            :sm="12"
+            :lg="8"
+          ><el-form-item prop="time" label="发货单时间">
+            <el-date-picker
+              v-model="invoiceOrderForm.time"
+              style="width: 100%"
+              type="daterange"
+              value-format="yyyy-MM-dd HH:mm:ss"
+              range-separator="至"
+              start-placeholder="开始日期"
+              end-placeholder="结束日期"
+            /></el-form-item></el-col>
+          <el-col
+            :xs="24"
+            :sm="12"
+            :lg="8"
+          ><el-form-item prop="userName" label="收货客户">
+            <el-input v-model="invoiceOrderForm.userName" /> </el-form-item></el-col>
+          <el-col
+            :xs="24"
+            :sm="12"
+            :lg="8"
+          ><el-form-item prop="address" label="收货地址">
+            <el-input v-model="invoiceOrderForm.address" /> </el-form-item></el-col>
+          <el-col
+            :xs="24"
+            :sm="12"
+            :lg="8"
+          ><el-form-item prop="remark" label="内容"> <el-input v-model="invoiceOrderForm.remark" /> </el-form-item></el-col>
+          <el-col :xs="24" :sm="12" :lg="8">
+            <el-button size="mini" @click="handleReset('invoiceOrde')">重置</el-button>
+            <el-button size="mini" type="primary" @click="getListInvoiceOrder">查询</el-button>
+          </el-col>
+        </el-row>
+      </el-form>
       <el-table
         ref="table"
         v-loading="listLoading"
@@ -134,7 +178,7 @@
                 <div style="display: flex">
                   <el-input v-model="specification" clearable style="margin-right: 10px" />
                   <el-button @click="handleReset">重置</el-button>
-                  <el-button type="primary" @click="getArrivalNotice">查询</el-button>
+                  <el-button type="primary" size="mini" @click="getArrivalNotice">查询</el-button>
                 </div>
               </el-form-item>
             </el-col>
@@ -224,10 +268,10 @@
                 :preview-src-list="[imageURL + item.url]"
               />
               <div v-else class="box2" @click="openLink(item.url)">
-                <img v-if="checkFileType(item.url) == 'word'" src="@/assets/common/word.png" />
-                <img v-if="checkFileType(item.url) == 'excel'" src="@/assets/common/excel.png" />
-                <img v-if="checkFileType(item.url) == 'ppt'" src="@/assets/common/ppt.png" />
-                <img v-if="checkFileType(item.url) == 'pdf'" src="@/assets/common/pdf.png" />
+                <img v-if="checkFileType(item.url) == 'word'" src="@/assets/common/word.png">
+                <img v-if="checkFileType(item.url) == 'excel'" src="@/assets/common/excel.png">
+                <img v-if="checkFileType(item.url) == 'ppt'" src="@/assets/common/ppt.png">
+                <img v-if="checkFileType(item.url) == 'pdf'" src="@/assets/common/pdf.png">
                 <div class="name ellipsis-3">{{ item.name }}</div>
               </div>
             </div>
@@ -289,6 +333,7 @@ import { getArrivalNotice } from '@/api/stock'
 import { getListOrderTrack } from '@/api/supply/pickup'
 import { getFileUrl } from '@/api/common'
 export default {
+  // eslint-disable-next-line vue/require-prop-types
   props: ['mesType'],
   data() {
     return {
@@ -309,6 +354,15 @@ export default {
       logisticsDetail: [],
       arrivalNoticeList: [],
       specification: '',
+      invoiceOrderForm: {
+        time: [],
+        invoiceId: '',
+        address: '',
+        startTime: '',
+        endTime: '',
+        remark: '',
+        userName: ''
+      },
       fnArr: ['getDataList', 'getFileList', 'getRebateList', 'getListInvoiceOrder', 'getArrivalNotice']
     }
   },
@@ -367,9 +421,14 @@ export default {
     },
     // 获取物流列表
     async getListInvoiceOrder() {
+      const time = this.invoiceOrderForm.time
+      delete this.invoiceOrderForm.time
       const data = {
         pageSize: this.pageSize,
-        pageNum: this.currentPage
+        pageNum: this.currentPage,
+        ...this.invoiceOrderForm,
+        startTime: time.length ? time[0] : '',
+        endTime: time.length ? time[1] : ''
       }
       const res = await getListInvoiceOrder(data)
       this.invoiceOrderList = res.data.records
@@ -385,11 +444,16 @@ export default {
       this.arrivalNoticeList = res.data.records
       this.listTotal = res.data.total
     },
-    handleReset() {
+    handleReset(type) {
       this.pageSize = 10
       this.pageNum = 1
-      this.specification = ''
-      this.getArrivalNotice()
+      if (type) {
+        this.$refs.invoiceOrderForm.resetFields()
+        this.getListInvoiceOrder()
+      } else {
+        this.specification = ''
+        this.getArrivalNotice()
+      }
     },
     // 更改每页数量
     handleSizeChange(val) {
@@ -487,4 +551,11 @@ export default {
 }
 </script>
 
-<style lang="scss" scoped></style>
+<style lang="scss" scoped>
+::v-deep .el-form-item--mini .el-form-item__content, ::v-deep .el-form-item--mini .el-form-item__label{
+  line-height: 27px;
+}
+::v-deep .el-range-editor--mini .el-range-separator {
+  line-height: 27px;
+}
+</style>

+ 4 - 4
src/layout/components/AppMain.vue

@@ -17,7 +17,7 @@
 <script>
 import { mapGetters } from 'vuex'
 import { setModuleId } from '@/utils/request'
-import { getListInvoiceOrder } from '@/api/dashboard'
+import { getListInvoiceOrderTWO } from '@/api/dashboard'
 import NotifyBox from '@/components/NotifyBox'
 export default {
   name: 'AppMain',
@@ -61,7 +61,7 @@ export default {
     handleInterVal() {
       this.handleClearInterVal()
       this.timer = setInterval(() => {
-        this.getListInvoiceOrder()
+        this.getListInvoiceOrderTWO()
       }, 20000)
     },
     handleClearInterVal() {
@@ -90,12 +90,12 @@ export default {
       })
     },
     // 获取物流列表
-    async getListInvoiceOrder() {
+    async getListInvoiceOrderTWO() {
       const data = {
         pageSize: this.pageSize,
         pageNum: this.currentPage
       }
-      const res = await getListInvoiceOrder(data)
+      const res = await getListInvoiceOrderTWO(data)
       this.invoiceOrderList = res.data.records
       this.listTotal = res.data.total
       if (res.data.records.length) {