Pārlūkot izejas kodu

1.PC端 出库工单 每次弹提示弹窗时,上方不应再出现明细按钮
2.PC端 库存查询打开明细账会出现两个重复的出库工单弹窗
3.PC端 优化tag重复拦截代码 避免出现两个相同的tag才提示
4.PC端 首页画公告列表 联调接口
5.PC端 画公告列表和详情页面 联调接口

Qukatie 6 dienas atpakaļ
vecāks
revīzija
30588903aa

+ 24 - 0
src/api/wel/bulletin.js

@@ -0,0 +1,24 @@
+import request from '@/router/axios';
+/**
+ * 公告首页列表  
+ * @param {any} data
+ */
+export const getList = (data) => {
+    return request({
+        url: '/api/gubersail-admin/bladenotice/list',
+        method: 'get',
+        params:data
+    })
+}
+/**
+ * 公告详情
+ * @param {any} params
+ */
+export const detail = (params) => {
+    return request({
+        url: '/api/gubersail-admin/bladenotice/detail',
+        method: 'get',
+        params: params
+    })
+}
+

+ 6 - 6
src/permission.js

@@ -61,12 +61,12 @@ router.beforeEach((to, from, next) => {
             })(),
             group: router.$avueRouter.group || []
           });
-          let tagList = getStore({
-            name: 'tagList'
-          })
-          if (tagList.filter(item => item.label == to.name).length > 1) {
-            return MessageBox.alert(`请关闭重复的${to.name}标签,否则无法进行操作!`,'提示', { type: 'warning' });
-          }
+          // let tagList = getStore({
+          //   name: 'tagList'
+          // })
+          // if (tagList.filter(item => item.label == to.name).length > 1) {
+          //   return MessageBox.alert(`请关闭重复的${to.name}标签,否则无法进行操作!`,'提示', { type: 'warning' });
+          // }
         }
         next()
       }

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

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

+ 4 - 1
src/store/modules/tags.js

@@ -53,8 +53,11 @@ const navs = {
         name: 'tag',
         content: state.tag
       })
+      console.log(action)
       if (state.tagList.some(ele => diff(ele, action))) return
-      // if(state.tagList.some(ele => tabsDiff(ele, action))) return MessageBox.alert(`存在重复的标签,请关闭${action.label}再进行操作`,'警告', { type: 'error' });
+      if (state.tagList.filter(item => item.label == action.label).length == 1) {
+        return MessageBox.alert(`请关闭重复的${action.label}标签,否则无法进行操作!`, '提示', { type: 'warning' });
+      }
       state.tagList.push(action)
       setFistTag(state.tagList);
       setStore({

+ 91 - 0
src/views/bulletin/detailsPage.vue

@@ -0,0 +1,91 @@
+<template>
+  <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="公告内容">
+        <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>
+      </trade-card>
+    </div>
+  </div>
+</template>
+
+<script>
+// @ts-nocheck
+import { detail } from "@/api/wel/bulletin.js";
+export default {
+  name: "detailsPage",
+  data() {
+    return {
+      form: {},
+    };
+  },
+  components: {},
+  props: {
+    detailData: Object,
+  },
+  created() {
+    if (this.detailData && this.detailData.id) {
+      this.getDetail(this.detailData.id);
+    }
+  },
+  methods: {
+    /**
+     * @param {any} id
+     */
+    getDetail(id) {
+      const loading = this.$loading({
+        lock: true,
+        text: "加载中",
+        spinner: "el-icon-loading",
+        background: "rgba(255,255,255,0.7)",
+      });
+      detail({ id: id })
+        .then((res) => {
+          this.form = res.data.data;
+        })
+        .finally(() => {
+          loading.close();
+        });
+    },
+    /**
+     * @param {any} type
+     */
+    goBack(type) {
+      this.$emit("goBack");
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+::v-deep .el-form-item__error {
+  display: none !important;
+}
+
+::v-deep .el-form-item {
+  margin-bottom: 8px !important;
+}
+
+::v-deep .el-table .cell {
+  padding: 0 2px !important;
+
+  .el-form-item {
+    margin-bottom: 0px !important;
+  }
+}
+::v-deep .el-table--small td,
+.el-table--small th {
+  padding: 2px !important;
+}
+</style>

+ 235 - 0
src/views/bulletin/index.vue

@@ -0,0 +1,235 @@
+<template>
+  <div>
+    <basic-container v-if="isShow">
+      <avue-crud
+        ref="crud"
+        :option="option"
+        :table-loading="loading"
+        :data="data"
+        :page.sync="page"
+        :search.sync="query"
+        @search-change="searchChange"
+        @search-reset="searchReset"
+        @selection-change="selectionChange"
+        @current-change="currentChange"
+        @size-change="sizeChange"
+        @refresh-change="refreshChange"
+        @on-load="onLoad"
+      >
+        <template slot="title" slot-scope="{ row }">
+          <span style="color: #1e9fff; cursor: pointer" @click="rowEdit(row)">
+            {{ row.title }}
+          </span>
+        </template>
+      </avue-crud>
+    </basic-container>
+    <detailsPage v-if="!isShow" :detailData="detailData" @goBack="goBack"></detailsPage>
+  </div>
+</template>
+
+<script>
+// @ts-nocheck
+import { getList } from "@/api/wel/bulletin.js";
+import detailsPage from "./detailsPage.vue";
+export default {
+  data() {
+    return {
+      isShow: true,
+      form: {},
+      query: {},
+      loading: false,
+      page: {
+        pageSize: 10,
+        currentPage: 1,
+        total: 0,
+      },
+      selectionList: [],
+      option: {
+        height: "auto",
+        calcHeight: 30,
+        menu:false,
+        menuWidth: 140,
+        tip: false,
+        searchShow: true,
+        searchMenuSpan: 6,
+        header:false,
+        border: true,
+        index: true,
+        addBtn: false,
+        viewBtn: false,
+        editBtn: false,
+        delBtn: false,
+        selection: true,
+        searchIcon: true,
+        align: "center",
+        searchIndex: 3,
+        column: [
+          {
+            label: "公告标题",
+            prop: "title",
+            overHidden: true,
+          },
+          {
+            label: "分类名称",
+            prop: "categoryName",
+            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: [],
+    };
+  },
+  components: {
+    detailsPage,
+  },
+  created() {},
+  methods: {
+    addButton() {
+      this.isShow = false;
+    },
+    /**
+     * @param {{ id: any; }} row
+     */
+    rowEdit(row) {
+      this.detailData = {
+        id: row.id,
+      };
+      this.isShow = false;
+    },
+    // 删除
+    /**
+     * @param {{ item: number; id: any; }} row
+     * @param {any} index
+     */
+    rowDel(row, index) {
+      if (row.item == 1) {
+        return this.$message.error("存在明细不允许删除");
+      }
+      this.$confirm("确定将选择数据删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      }).then(() => {
+        remove({ ids: row.id }).then((res) => {
+          this.onLoad(this.page, this.query);
+          this.$message.success("成功删除");
+        });
+      });
+    },
+    searchReset() {
+      this.query = this.$options.data().query;
+      this.onLoad(this.page);
+    },
+    // 搜索按钮点击
+    /**
+     * @param {any} params
+     * @param {() => void} done
+     */
+    searchChange(params, done) {
+      this.page.currentPage = 1;
+      this.onLoad(this.page, this.query);
+      done();
+    },
+    /**
+     * @param {any} list
+     */
+    selectionChange(list) {
+      this.selectionList = list;
+    },
+    /**
+     * @param {any} currentPage
+     */
+    currentChange(currentPage) {
+      this.page.currentPage = currentPage;
+    },
+    /**
+     * @param {any} pageSize
+     */
+    sizeChange(pageSize) {
+      this.page.pageSize = pageSize;
+    },
+    refreshChange() {
+      this.onLoad(this.page, this.query);
+    },
+    /**
+     * @param {{ currentPage: any; pageSize: any; }} page
+     */
+    onLoad(page, params = {}) {
+      let obj = {
+        visibleRoles: 2,
+      };
+      this.loading = true;
+      getList(obj)
+        .then((res) => {
+          this.data = res.data.data;
+        })
+        .finally(() => {
+          this.loading = false;
+        });
+    },
+    // 详情的返回列表
+    goBack() {
+      // 初始化数据
+      if (JSON.stringify(this.$route.query) != "{}") {
+        this.$router.$avueRouter.closeTag();
+        this.$router.push({
+          path: "/claimSettlement/index",
+        });
+      }
+      this.detailData = {};
+      this.isShow = true;
+      this.onLoad(this.page, this.query);
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+::v-deep .el-col-md-8 {
+  width: 24.33333%;
+}
+::v-deep .avue-crud .el-table .el-button.el-button--small {
+  padding: 0px !important;
+  margin-right: 0px !important;
+}
+</style>

+ 57 - 0
src/views/wel/components/bulletin.vue

@@ -0,0 +1,57 @@
+<template>
+  <div>
+    <div>
+      <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>
+      </el-card>
+    </div>
+  </div>
+</template>
+
+<script>
+// @ts-nocheck
+import { getList } from "@/api/wel/bulletin.js";
+export default {
+  data() {
+    return {
+      data: [],
+    };
+  },
+  created() {
+    this.getData();
+  },
+  components: {},
+  methods: {
+    getData() {
+      let obj = {
+        visibleRoles: 2,
+      };
+      getList(obj)
+        .then((res) => {
+          this.data = res.data.data;
+        })
+        .finally(() => {
+          this.loading = false;
+        });
+    },
+    inPage() {
+        this.$router.push('/bulletin/index')
+    },
+  },
+};
+</script>
+<style lang="scss" scoped></style>

+ 60 - 57
src/views/wel/index.vue

@@ -1,5 +1,7 @@
 <template>
-<div></div>
+  <div style="padding: 10px">
+    <bulletin></bulletin>
+  </div>
 </template>
 
 <script>
@@ -7,75 +9,76 @@ import { getUserInfo } from "@/api/system/user";
 import { setStore } from "@/util/store";
 import { getLazyList } from "@/api/system/dept";
 import { areaTypeTree } from "@/api/fc/customerInformation";
+import bulletin from "./components/bulletin.vue";
 export default {
-    name: "wel",
-    data() {
-        return {
-            billType: "",
-            saberTenantId: '',
-            roler: '',
-            rolerShow: true,
-        };
-    },
-    created() {
-        this.saberTenantId = JSON.parse(localStorage.getItem('saber-tenantId')).content
-        let obj = JSON.parse(localStorage.getItem('saber-userInfo')).content
-        if (obj) {
-            this.roler = obj.role_name
-            this.getRegex(this.roler)
-        }
-        getUserInfo().then(res => {
-            this.billType = res.data.data.billType;
-            localStorage.setItem('sysitemType', this.billType)
-            localStorage.setItem('sysitemData', JSON.stringify(res.data.data))
-        });
-        getLazyList().then(res => {
-            localStorage.setItem('user-Information', res.data.data.length ? JSON.stringify(res.data.data[0]) : null)
-        })
-        
-        if (!localStorage.getItem('areaTypeTree')) {
-            areaTypeTree().then(res => {
-                localStorage.setItem('areaTypeTree', JSON.stringify(res.data.data));
-            })
-        }
+  name: "wel",
+  components: {
+    bulletin,
+  },
+  data() {
+    return {
+      billType: "",
+      saberTenantId: "",
+      roler: "",
+      rolerShow: true,
+    };
+  },
+  created() {
+    this.saberTenantId = JSON.parse(localStorage.getItem("saber-tenantId")).content;
+    let obj = JSON.parse(localStorage.getItem("saber-userInfo")).content;
+    if (obj) {
+      this.roler = obj.role_name;
+      this.getRegex(this.roler);
+    }
+    getUserInfo().then((res) => {
+      this.billType = res.data.data.billType;
+      localStorage.setItem("sysitemType", this.billType);
+      localStorage.setItem("sysitemData", JSON.stringify(res.data.data));
+    });
+    getLazyList().then((res) => {
+      localStorage.setItem("user-Information", res.data.data.length ? JSON.stringify(res.data.data[0]) : null);
+    });
+
+    if (!localStorage.getItem("areaTypeTree")) {
+      areaTypeTree().then((res) => {
+        localStorage.setItem("areaTypeTree", JSON.stringify(res.data.data));
+      });
+    }
+  },
+  methods: {
+    getRegex(str) {
+      let regex = new RegExp("API", "g"); // g 标志表示全局匹配
 
+      let matches = str.match(regex);
+      if (matches) {
+        this.rolerShow = false;
+      } else {
+        this.rolerShow = true;
+      }
     },
-    components: {
+    inPage(url) {
+      this.$router.push(url);
     },
-    methods: {
-        getRegex(str) {
-            let regex = new RegExp('API', "g"); // g 标志表示全局匹配
-
-            let matches = str.match(regex);
-            if (matches) {
-                this.rolerShow = false
-            } else {
-                this.rolerShow = true
-            }
-        },
-        inPage(url) {
-            this.$router.push(url);
-        },
-    }
+  },
 };
 </script>
 <style lang="scss" scoped>
 .content {
-    display: flex;
+  display: flex;
 
-    &-icon {
-        display: flex;
-        flex-direction: column;
-        align-items: center;
-        margin: 1.5vh 1vw 0vh 1vw;
+  &-icon {
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+    margin: 1.5vh 1vw 0vh 1vw;
 
-        span {
-            margin-top: 0.2vh;
-        }
+    span {
+      margin-top: 0.2vh;
     }
+  }
 }
 
 .tradingIcon {
-    font-size: 36px;
+  font-size: 36px;
 }
 </style>