Browse Source

修改公告栏

Qukatie 1 month ago
parent
commit
cd2db31021

+ 14 - 0
src/router/views/index.js

@@ -663,5 +663,19 @@ export default [
             },
             },
             component: () => import( /* webpackChunkName: "views" */ '@/views/bulletin/index.vue')
             component: () => import( /* webpackChunkName: "views" */ '@/views/bulletin/index.vue')
         }]
         }]
+    },
+    {
+        path: '/bulletin/details',
+        component: Layout,
+        hidden: true,
+        children: [{
+            path: '/bulletin/details',
+            name: '公告内容',
+            meta: {
+                i18n: '/bulletin/details',
+                keepAlive: true,
+            },
+            component: () => import( /* webpackChunkName: "views" */ '@/views/bulletin/details.vue')
+        }]
     }
     }
 ];
 ];

+ 4 - 17
src/views/bulletin/detailsPage.vue → src/views/bulletin/details.vue

@@ -1,22 +1,9 @@
 <template>
 <template>
   <div>
   <div>
-    <div class="customer-head">
-      <div class="customer-back">
-        <el-button
-          type="danger"
-          style="border: none; background: none; color: red"
-          icon="el-icon-arrow-left"
-          @click="goBack()"
-          >返回列表
-        </el-button>
-      </div>
-    </div>
-    <div style="margin-top: 50px">
-      <trade-card title="公告内容">
+     <el-card style="margin: 6px;">
         <div style="display: flex;justify-content: center;margin: 20px 0;font-size: 20px;font-weight: 600;">{{ form.title }}</div>
         <div style="display: flex;justify-content: center;margin: 20px 0;font-size: 20px;font-weight: 600;">{{ form.title }}</div>
         <div v-html="form.content" style="padding: 20px;"></div>
         <div v-html="form.content" style="padding: 20px;"></div>
-      </trade-card>
-    </div>
+      </el-card>
   </div>
   </div>
 </template>
 </template>
 
 
@@ -35,8 +22,8 @@ export default {
     detailData: Object,
     detailData: Object,
   },
   },
   created() {
   created() {
-    if (this.detailData && this.detailData.id) {
-      this.getDetail(this.detailData.id);
+    if (this.$route.query && this.$route.query.id) {
+      this.getDetail(this.$route.query.id);
     }
     }
   },
   },
   methods: {
   methods: {

+ 13 - 51
src/views/bulletin/index.vue

@@ -23,14 +23,12 @@
         </template>
         </template>
       </avue-crud>
       </avue-crud>
     </basic-container>
     </basic-container>
-    <detailsPage v-if="!isShow" :detailData="detailData" @goBack="goBack"></detailsPage>
   </div>
   </div>
 </template>
 </template>
 
 
 <script>
 <script>
 // @ts-nocheck
 // @ts-nocheck
 import { getList } from "@/api/wel/bulletin.js";
 import { getList } from "@/api/wel/bulletin.js";
-import detailsPage from "./detailsPage.vue";
 export default {
 export default {
   data() {
   data() {
     return {
     return {
@@ -47,12 +45,12 @@ export default {
       option: {
       option: {
         height: "auto",
         height: "auto",
         calcHeight: 30,
         calcHeight: 30,
-        menu:false,
+        menu: false,
         menuWidth: 140,
         menuWidth: 140,
         tip: false,
         tip: false,
         searchShow: true,
         searchShow: true,
         searchMenuSpan: 6,
         searchMenuSpan: 6,
-        header:false,
+        header: false,
         border: true,
         border: true,
         index: true,
         index: true,
         addBtn: false,
         addBtn: false,
@@ -74,54 +72,12 @@ export default {
             prop: "categoryName",
             prop: "categoryName",
             overHidden: true,
             overHidden: true,
           },
           },
-          {
-            label: "组织名称",
-            prop: "orgName",
-            overHidden: true,
-          },
-          {
-            label: "备注",
-            prop: "remark",
-            overHidden: true,
-          },
-          {
-            label: "制单人",
-            prop: "createUserName",
-            overHidden: true,
-            width: 80,
-          },
-          {
-            label: "制单日期",
-            prop: "createTime",
-            type: "date",
-            overHidden: true,
-            width: 100,
-            format: "yyyy-MM-dd",
-            valueFormat: "yyyy-MM-dd HH:mm:ss",
-          },
-          {
-            label: "修改人",
-            prop: "updateUserName",
-            overHidden: true,
-            width: 80,
-          },
-          {
-            label: "修改日期",
-            prop: "updateTime",
-            type: "date",
-            overHidden: true,
-            width: 100,
-            format: "yyyy-MM-dd",
-            valueFormat: "yyyy-MM-dd HH:mm:ss",
-          },
         ],
         ],
       },
       },
       data: [],
       data: [],
     };
     };
   },
   },
-  components: {
-    detailsPage,
-  },
+  components: {},
   created() {},
   created() {},
   methods: {
   methods: {
     addButton() {
     addButton() {
@@ -131,10 +87,16 @@ export default {
      * @param {{ id: any; }} row
      * @param {{ id: any; }} row
      */
      */
     rowEdit(row) {
     rowEdit(row) {
-      this.detailData = {
-        id: row.id,
-      };
-      this.isShow = false;
+      // this.detailData = {
+      //   id: row.id,
+      // };
+      // this.isShow = false;
+      this.$router.push({
+        path: `/bulletin/details`,
+        query: {
+          id: row.id
+        },
+      });
     },
     },
     // 删除
     // 删除
     /**
     /**

+ 22 - 15
src/views/wel/components/bulletin.vue

@@ -2,20 +2,19 @@
   <div>
   <div>
     <div>
     <div>
       <el-card style="font-family: 'Microsoft YaHei'; font-weight: 600">
       <el-card style="font-family: 'Microsoft YaHei'; font-weight: 600">
-        <div style="display: flex; margin: 10px">
-          <div style="width: 100px; height: 100px; display: flex; justify-content: center; align-items: center">
-            <i class="el-icon-date" style="font-size: 36px; color: #03803b"></i>
-          </div>
-          <div style="margin-left: 20px; display: flex; justify-content: space-between; width: 100%">
-            <div>
-              <div v-for="(item, index) in data" :key="index">
-                <div>{{ item.title }}</div>
-              </div>
-            </div>
-            <div>
-              <el-link style="color: #03803b;font-size: 20px;font-weight: 600;" type="success" @click="inPage"> 更多公告 </el-link>
-            </div>
-          </div>
+        <div slot="header" style="font-size: 18px">
+          <span>公告栏</span>
+          <el-button style="float: right; padding: 3px 0; font-weight: 600" type="text" @click="inPage"
+            >更多公告</el-button
+          >
+        </div>
+        <div v-for="item in data" :key="item.id" style="font-size: 14px">
+          <span style="cursor: pointer" @click="rowEdit(item)">
+            {{ item.title }}
+          </span>
+        </div>
+        <div v-if="data.length == 0" style="font-size: 14px; color: #c0c4cc">
+          <div>暂无公告</div>
         </div>
         </div>
       </el-card>
       </el-card>
     </div>
     </div>
@@ -49,7 +48,15 @@ export default {
         });
         });
     },
     },
     inPage() {
     inPage() {
-        this.$router.push('/bulletin/index')
+      this.$router.push("/bulletin/index");
+    },
+    rowEdit(row) {
+      this.$router.push({
+        path: `/bulletin/details`,
+        query: {
+          id: row.id,
+        },
+      });
     },
     },
   },
   },
 };
 };

+ 26 - 0
src/views/wel/distributor.vue

@@ -0,0 +1,26 @@
+<template>
+  <div style="padding: 10px">
+    <bulletin></bulletin>
+  </div>
+</template>
+
+<script>
+// @ts-nocheck
+import bulletin from "./components/bulletin.vue";
+export default {
+  name: "wel",
+  components: {
+    bulletin,
+  },
+  data() {
+    return {
+    };
+  },
+  created() {
+  },
+  methods: {
+  },
+};
+</script>
+<style lang="scss" scoped>
+</style>

+ 27 - 0
src/views/wel/factory.vue

@@ -0,0 +1,27 @@
+<template>
+  <div style="padding: 10px">
+    工厂端
+  </div>
+</template>
+
+<script>
+// @ts-nocheck
+import { getUserInfo } from "@/api/system/user";
+import { setStore } from "@/util/store";
+import { getLazyList } from "@/api/system/dept";
+import { areaTypeTree } from "@/api/fc/customerInformation";
+export default {
+  name: "wel",
+  components: { },
+  data() {
+    return {
+    };
+  },
+  created() {
+  },
+  methods: {
+  },
+};
+</script>
+<style lang="scss" scoped>
+</style>

+ 10 - 3
src/views/wel/index.vue

@@ -1,19 +1,25 @@
 <template>
 <template>
   <div style="padding: 10px">
   <div style="padding: 10px">
-    <bulletin></bulletin>
+    <!-- 工厂端首页 -->
+    <factory v-if="roleName.includes('administrator')||roleName.includes('工厂')"></factory>
+    <!-- 经销商首页 -->
+    <distributor v-if="roleName.includes('经销商')"></distributor>
   </div>
   </div>
 </template>
 </template>
 
 
 <script>
 <script>
+// @ts-nocheck
 import { getUserInfo } from "@/api/system/user";
 import { getUserInfo } from "@/api/system/user";
 import { setStore } from "@/util/store";
 import { setStore } from "@/util/store";
 import { getLazyList } from "@/api/system/dept";
 import { getLazyList } from "@/api/system/dept";
 import { areaTypeTree } from "@/api/fc/customerInformation";
 import { areaTypeTree } from "@/api/fc/customerInformation";
-import bulletin from "./components/bulletin.vue";
+import factory from "./factory.vue";
+import distributor from "./distributor.vue";
 export default {
 export default {
   name: "wel",
   name: "wel",
   components: {
   components: {
-    bulletin,
+    factory,
+    distributor,
   },
   },
   data() {
   data() {
     return {
     return {
@@ -21,6 +27,7 @@ export default {
       saberTenantId: "",
       saberTenantId: "",
       roler: "",
       roler: "",
       rolerShow: true,
       rolerShow: true,
+      roleName: localStorage.getItem("roleName").split(","),
     };
     };
   },
   },
   created() {
   created() {