浏览代码

发货通知框

zhouhao 2 年之前
父节点
当前提交
7844707e31
共有 1 个文件被更改,包括 40 次插入62 次删除
  1. 40 62
      src/layout/components/Navbar.vue

+ 40 - 62
src/layout/components/Navbar.vue

@@ -68,14 +68,7 @@
       </div>
     </el-dialog>
 
-    <el-dialog
-      title="到货通知"
-      :modal="false"
-      width="70%"
-      :visible.sync="hasNotice"
-      center
-      @close="handleNotice(false)"
-    >
+    <el-dialog title="到货通知" :modal="false" width="70%" :visible.sync="hasNotice" center @close="handleNotice(false)">
       <div class="mymain-container">
         <el-form ref="form" :model="form" label-width="80px" label-position="left" size="mini">
           <el-row>
@@ -83,13 +76,10 @@
               <el-form-item prop="specification" label="规格型号">
                 <div style="display: flex">
                   <el-input v-model="form.specification" clearable style="margin-right: 10px" />
-                  <el-button
-                    @click="
-                      form.specification = ''
-                      getNoticeList()
-                    "
-                    >重置</el-button
-                  >
+                  <el-button @click="
+  form.specification = ''
+                    getNoticeList()
+                  ">重置</el-button>
                   <el-button type="primary" @click="getNoticeList">查询</el-button>
                 </div>
               </el-form-item>
@@ -98,55 +88,21 @@
         </el-form>
         <div class="table">
           <el-table v-loading="listLoading" :data="noticeList" border>
-            <el-table-column
-              property="materialOldNumber"
-              align="left"
-              min-width="120"
-              label="产品编号"
-              show-overflow-tooltip
-            />
-            <el-table-column
-              property="materialNumber"
-              align="left"
-              min-width="100"
-              label="物料编码"
-              show-overflow-tooltip
-            />
-            <el-table-column
-              property="materialName"
-              align="left"
-              min-width="250"
-              label="产品名称"
-              show-overflow-tooltip
-            />
-            <el-table-column
-              property="specification"
-              align="left"
-              min-width="350"
-              label="规格型号"
-              show-overflow-tooltip
-            />
+            <el-table-column property="materialOldNumber" align="left" min-width="120" label="产品编号"
+              show-overflow-tooltip />
+            <el-table-column property="materialNumber" align="left" min-width="100" label="物料编码"
+              show-overflow-tooltip />
+            <el-table-column property="materialName" align="left" min-width="250" label="产品名称" show-overflow-tooltip />
+            <el-table-column property="specification" align="left" min-width="350" label="规格型号" show-overflow-tooltip />
             <el-table-column property="stockName" align="left" min-width="100" label="到货仓库" show-overflow-tooltip />
-            <el-table-column
-              property="updateTime"
-              align="left"
-              min-width="200"
-              label="到货通知时间"
-              show-overflow-tooltip
-            />
+            <el-table-column property="updateTime" align="left" min-width="200" label="到货通知时间" show-overflow-tooltip />
           </el-table>
           <div class="flex">
             <div />
             <div class="fr">
-              <el-pagination
-                :current-page="currentPage"
-                :page-sizes="[10, 20, 30, 50]"
-                :page-size="10"
-                layout="total, prev, pager, next"
-                :total="listTotal"
-                @size-change="handleSizeChange"
-                @current-change="handleCurrentChange"
-              />
+              <el-pagination :current-page="currentPage" :page-sizes="[10, 20, 30, 50]" :page-size="10"
+                layout="total, prev, pager, next" :total="listTotal" @size-change="handleSizeChange"
+                @current-change="handleCurrentChange" />
             </div>
           </div>
         </div>
@@ -213,6 +169,7 @@ import { getNoticeListCount } from '@/api/notice'
 import { getNoticeList } from '@/api/stock'
 import { bindEngineAccount, checkEngineAccount } from '@/api/setting'
 import mixin from '@/mixin'
+import ret from 'bluebird/js/release/util'
 export default {
   components: {
     Breadcrumb,
@@ -282,7 +239,12 @@ export default {
     },
     hasNotice: {
       get() {
-        return this.isNotice
+        // 数据为空是不展示消息通知弹框
+        if (!this.noticeList.length) {
+          return false
+        } else {
+          return this.isNotice
+        }
       },
       set(e) {
         return e
@@ -301,9 +263,11 @@ export default {
         pageSize: this.pageSize,
         specification: this.form.specification
       }).then(res => {
+
         this.noticeList = res.data.records
         this.listTotal = res.data.total
         this.listLoading = false
+
       })
     },
     handleNotice(flag = true) {
@@ -539,21 +503,25 @@ export default {
 
 <style lang="scss" scoped>
 @import '~@/styles/variables.scss';
+
 ::v-deep .is-fixed {
   right: 10px !important;
 }
+
 .flex {
   margin-top: 30px;
   display: flex;
   align-items: center;
   justify-content: space-between;
 }
+
 .navbar {
   width: 100%;
   height: 50px;
   overflow: hidden;
   background: #{$navbarBg};
   box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
+
   .hamburger-container {
     line-height: 46px;
     height: 100%;
@@ -563,6 +531,7 @@ export default {
     transition: background 0.3s;
     -webkit-tap-highlight-color: transparent;
     border-right: 1px solid #eaeaea;
+
     &:hover {
       background: rgba(0, 0, 0, 0.025);
     }
@@ -580,24 +549,30 @@ export default {
     float: right;
     height: 100%;
     line-height: 50px;
-    & > div {
+
+    &>div {
       float: left;
     }
+
     &:focus {
       outline: none;
     }
+
     .user-container {
       height: 50px;
+
       .user {
         i {
           font-size: 18px;
           margin-right: 5px;
         }
+
         span {
           font-size: 16px;
         }
       }
     }
+
     .right-menu-item {
       display: inline-block;
       padding: 0 15px;
@@ -606,6 +581,7 @@ export default {
       color: #{$navbarText};
       vertical-align: text-bottom;
       border-left: 1px solid #eaeaea;
+
       &.hover-effect {
         cursor: pointer;
         transition: background 0.3s;
@@ -614,6 +590,7 @@ export default {
           background: rgba(0, 0, 0, 0.025);
         }
       }
+
       .notice-icon {
         padding-top: 0;
         padding-bottom: 0;
@@ -627,9 +604,10 @@ export default {
 .navbar {
   .right-menu {
     .right-menu-item {
-      .notice-icon > i {
+      .notice-icon>i {
         font-size: 18px;
       }
+
       sup {
         top: 12px;
         right: 25px;