Qukatie hai 1 mes
pai
achega
c07006c634

+ 38 - 0
src/api/lock/businessUnlocking.js

@@ -0,0 +1,38 @@
+import request from '@/router/axios';
+
+// 上锁
+export function submitLock(data) {
+  return request({
+    url: '/api/blade-los/billlocks/submitLock',
+    method: 'post',
+    data: data
+  })
+}
+// 解锁
+export function unLock(data) {
+  return request({
+    url: '/api/blade-los/billlocks/unlock',
+    method: 'get',
+    params: data
+  })
+}
+// 锁定列表查询
+export const lockList = (current, size, params) => {
+  return request({
+    url: '/api/blade-los/billlocks/list',
+    method: 'get',
+    params: {
+      ...params,
+      current,
+      size,
+    }
+  })
+}
+// 删除锁
+export function lockRemove(data) {
+  return request({
+    url: '/api/blade-los/billlocks/remove',
+    method: 'post',
+    params: data
+  })
+}

+ 3 - 0
src/enums/column-name.js

@@ -2024,6 +2024,9 @@ const columnName = [{
 },{
   code: 457,
   name: '货代-财务管理-发票申请(F)费用明细表'
+},{
+  code: 458,
+  name: '货代-系统管理-业务解锁(F)列表页'
 }
 ]
 export const getColumnName = (key) => {

+ 8 - 0
src/main.js

@@ -29,6 +29,7 @@ import {
   getWorkDicts
 } from '@/api/system/dictbiz'
 import { checkLock, onLock, unLock } from "@/api/lock/lock"
+import { submitLock } from "@/api/lock/businessUnlocking"
 import './util/directives.js'
 import Avue from '@smallwei/avue';
 import '@smallwei/avue/lib/index.css';
@@ -84,6 +85,10 @@ import {
 import {
   checkLocks
 } from "@/util/lock"
+//overdueJudgment
+import {
+  overdueJudgment
+} from "@/util/date"
 import {
   inDetailsKey,
   leaveDetailsKey
@@ -184,6 +189,9 @@ Vue.prototype.checkLock = checkLock;
 Vue.prototype.onLock = onLock;
 Vue.prototype.unLock = unLock;
 Vue.prototype.checkLocks = checkLocks;
+//业务上锁
+Vue.prototype.submitLock=submitLock;
+Vue.prototype.overdueJudgment=overdueJudgment;
 new Vue({
   router,
   store,

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

@@ -4074,4 +4074,18 @@ export default [{
     component: () => import( /* webpackChunkName: "views" */ '@/views/iosBasicData/revenueInvoicing/index')
   }]
 },
+{
+  path: '/system/businessUnlocking/index',
+  component: Layout,
+  hidden: true,
+  children: [{
+    path: '/system/businessUnlocking/index',
+    name: '业务解锁(F)',
+    meta: {
+      i18n: '/system/businessUnlocking/index', 
+      keepAlive: true,
+    },
+    component: () => import( /* webpackChunkName: "views" */ '@/views/system/businessUnlocking/index')
+  }]
+},
 ]

+ 22 - 1
src/util/date.js

@@ -208,7 +208,7 @@ export function getYearDate() {
 }
 export function getMonthDate() {
   const date = new Date();
-  return date.getMonth()+1
+  return date.getMonth() + 1
 }
 
 /**
@@ -279,4 +279,25 @@ export function checkFullWidthSymbols(text) {
       positions: []                // 符号的详细位置和内容
     };
   }
+}
+//判断是否超过设置天数
+export function overdueJudgment(date) {
+  const overDay = localStorage.getItem('lockTermDays')
+  if (overDay) {
+    const nowDate = new Date(dateFormat(new Date(),'yyyy-MM-dd'))
+
+    const startDate = new Date(dateFormat(new Date(date),'yyyy-MM-dd'))
+      console.log(dateFormat(nowDate,'yyyy-MM-dd'),dateFormat(startDate,'yyyy-MM-dd'),1111111111)
+    startDate.setDate(startDate.getDate() + Number(overDay))
+         console.log(dateFormat(nowDate,'yyyy-MM-dd'),dateFormat(startDate,'yyyy-MM-dd'),22222222)
+    if (startDate < nowDate) {
+      return true
+    } else {
+      return false
+    }
+  } else {
+    return false
+  }
+
+
 }

+ 8 - 2
src/views/iosBasicData/SeafreightExportF/bills/billsDetails.vue

@@ -54,7 +54,7 @@
                 </el-dropdown>
 
                 <el-button size="small" style="margin-right: 8px" :loading="saveLoading" :disabled="!form.id"
-                    v-if="bigtabs!='dz'" @click="previewDialogfun">预 览
+                    v-if="bigtabs != 'dz'" @click="previewDialogfun">预 览
                 </el-button>
                 <el-button size="small" type="warning" :disabled="!form.id || detailData.seeDisabled || showLock"
                     v-if="form.status == 1" @click.stop="revokeDocumentApproval">撤销单据请核
@@ -2527,7 +2527,13 @@ export default {
             const res = await billsDetail(id)
             // this.form = res.data.data;
             this.$set(this, 'form', res.data.data)
-            this.inLock()
+            if (this.overdueJudgment(res.data.data.locked==0?res.data.data.etd:res.data.data.lockedDate)) {
+                this.detailData.seeDisabled = true
+                this.$message.error("已锁账,请联系部门经理解锁");
+                this.submitLock({ srcId: res.data.data.id, businessType: 'HYCK' })
+            } else {
+                this.inLock()
+            }
             //   console.log('form', this.form)
             // console.log(this.$refs)
 

+ 60 - 0
src/views/system/businessUnlocking/config/mainList.json

@@ -0,0 +1,60 @@
+{
+  "searchShow": true,
+  "searchMenuSpan": 8,
+  "border": true,
+  "index": true,
+  "viewBtn": false,
+  "editBtn": false,
+  "delBtn": false,
+  "addBtn": false,
+  "align": "center",
+  "menuWidth": "120",
+  "menu": true,
+  "menuFixed":false,
+  "showSummary": true,
+  "searchIcon": true,
+  "searchIndex": 2,
+  "selection": true,
+  "indexFixed":false,
+  "tip":false,
+  "expand": false,
+  "expandWidth": 38,
+  "column": [
+    {
+      "label": "业务类型",
+      "prop": "businessTypeName",
+      "search": true,
+      "index": 2,
+      "minWidth": 80,
+      "overHidden": true,
+      "searchSpan": 8
+    },{
+      "label": "系统编号",
+      "prop": "billNo",
+      "search": true,
+      "index": 2,
+      "minWidth": 80,
+      "overHidden": true,
+      "searchSpan": 8
+    },{
+      "label": "操作员",
+      "prop": "realName",
+      "search": true,
+      "index": 3,
+      "minWidth": 80,
+      "overHidden": true,
+      "searchSpan": 8
+    },{
+      "label": "业务锁时间",
+      "prop": "lockTime",
+      "search": true,
+      "type": "date",
+      "unlinkPanels": true,
+      "searchRange": true,
+      "index": 4,
+      "minWidth": 80,
+      "overHidden": true,
+      "searchSpan": 8
+    }
+  ]
+}

+ 288 - 0
src/views/system/businessUnlocking/index.vue

@@ -0,0 +1,288 @@
+<template>
+  <div>
+    <basic-container>
+      <avue-crud :option="option" :data="dataList" ref="crud" v-model="form" :page.sync="page" :search.sync="search"
+        @search-change="searchChange" @current-change="currentChange" @size-change="sizeChange"
+        @refresh-change="refreshChange" @on-load="onLoad"
+        @resetColumn="resetColumn('crud', 'option', 'optionBack', 458)"
+        @saveColumn="saveColumn('crud', 'option', 'optionBack', 458)" :table-loading="loading"
+        @selection-change="selectionChange">
+        <template slot="menu" slot-scope="{ row, index }">
+          <!-- <el-button v-if="row.locked==0" type="text" icon="el-icon-unlock" size="small" @click="rowUnlock(row, index)">加锁</el-button> -->
+          <!-- <el-button v-if="row.locked==1" type="text" icon="el-icon-unlock" size="small" @click="rowOnlock(row, index)">解锁</el-button> -->
+          <el-button :disabled="row.locked != 0" type="text" icon="el-icon-delete" size="small"
+            @click="rowDel(row, index)">删除</el-button>
+        </template>
+        <template slot="menuLeft">
+          <el-button type="primary" size="small" @click="allClick" :disabled="selectionList.length == 0">一键解锁
+          </el-button>
+        </template>
+      </avue-crud>
+    </basic-container>
+  </div>
+</template>
+
+<script>
+import option from "./config/mainList.json";
+import { lockList, lockRemove, unLock } from "@/api/lock/businessUnlocking";
+import { getWorkDicts } from "@/api/system/dictbiz";
+export default {
+  name: "index",
+  data() {
+    return {
+      selectionList: [],
+      option: {},
+      optionBack: {
+        height: 'auto',
+        calcHeight: 30,
+        menuWidth: 80,
+        tip: false,
+        searchShow: true,
+        searchMenuSpan: 6,
+        border: true,
+        index: true,
+        addBtn: false,
+        viewBtn: false,
+        editBtn: false,
+        delBtn: false,
+        selection: true,
+        searchIcon: true,
+        align: 'center',
+        searchIndex: 3,
+        column: [
+          {
+            label: "业务类型",
+            prop: "businessTypeName",
+            width: "120",
+            search: true,
+            overHidden: true,
+          },
+          {
+            label: "业务编号",
+            prop: "srcBillNo",
+            width: "120",
+            search: true,
+            overHidden: true,
+          },
+          {
+            label: "单据日期",
+            prop: "billDate",
+            width: "120",
+            overHidden: true,
+            search: true,
+            searchProp: "billDateList",
+            type: "date",
+            unlinkPanels: true,
+            searchRange: true,
+            format: "yyyy-MM-dd",
+            valueFormat: "yyyy-MM-dd HH:mm:ss",
+            searchDefaultTime: ["00:00:00", "23:59:59"],
+          },
+          {
+            label: "船名",
+            prop: "srcVesselCnName",
+            width: "120",
+            overHidden: true,
+          },
+          {
+            label: "航次",
+            prop: "srcVoyageNo",
+            width: "120",
+            overHidden: true,
+          },
+          {
+            label: "MBLNO",
+            prop: "srcMblno",
+            width: "120",
+            overHidden: true,
+          },
+          {
+            label: "Reference",
+            prop: "rcRefno",
+            width: "120",
+            overHidden: true,
+          },
+          {
+            label: "加解锁操作时间",
+            prop: "lockedTime",
+            width: "120",
+            overHidden: true,
+          },
+          {
+            label: "累计已解锁次数",
+            prop: "unlockedCount",
+            width: "120",
+            overHidden: true,
+          },
+          {
+            label: "操作人",
+            prop: "operatorName",
+            width: "120",
+            overHidden: true,
+          }
+        ]
+      },
+      dataList: [],
+      form: {},
+      page: {
+        pageSize: 10,
+        pagerCount: 5,
+        total: 0
+      },
+      search: {},
+      loading: false,
+    };
+  },
+  async created() {
+    this.option = await this.getColumnData(this.getColumnName(458), this.optionBack);
+  },
+  filters: {
+    moudleNameFormat(row, moudleOption) {
+      let name;
+      moudleOption.map(e => {
+        if (row == e.dictKey) {
+          name = e.dictValue;
+        }
+      });
+      return name;
+    }
+  },
+  methods: {
+    selectionChange(list) {
+      this.selectionList = list
+    },
+    searchChange(params, done) {
+      this.onLoad(this.page, params);
+      done();
+    },
+    currentChange(val) {
+      this.page.currentPage = val;
+    },
+    sizeChange(val) {
+      this.page.currentPage = 1;
+      this.page.pageSize = val;
+    },
+    refreshChange() {
+      this.onLoad(this.page, this.search);
+    },
+    onLoad(page, params) {
+      this.dataList.forEach(item => {
+        this.$refs.crud.toggleRowExpansion(item, false);
+      });
+      this.loading = true;
+      lockList(page.currentPage, page.pageSize, params)
+        .then(res => {
+          this.dataList = res.data.data.records ? res.data.data.records : [];
+          this.page.total = res.data.data.total;
+          if (this.page.total) {
+            this.option.height = window.innerHeight - 260;
+          }
+          this.dataList.forEach(item => {
+            this.$set(item, "insideList", []);
+            this.$set(item, "loading", true);
+          });
+          this.$nextTick(() => {
+            this.$refs.crud.refreshTable()
+          });
+        })
+        .finally(() => {
+          this.loading = false;
+        });
+    },
+    rowDel(row) {
+      this.$confirm("确定将选择数据删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      })
+        .then(() => {
+          lockRemove({ids:row.id}).then(res => {
+            this.onLoad(this.page);
+            this.$message({
+              type: "success",
+              message: "操作成功!"
+            });
+          })
+        })
+    },
+    // 解锁
+    rowUnlock(row, index) {
+      this.$confirm("是否确认解锁?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        this.$message({
+          type: "success",
+          message: "操作成功!"
+        });
+        this.onLoad(this.page, this.search);
+      });
+    },
+    //加锁
+    rowOnlock(row, index) {
+      this.$confirm("是否确认加锁?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        this.$message({
+          type: "success",
+          message: "操作成功!"
+        });
+        this.onLoad(this.page, this.search);
+      });
+    },
+    allClick() {
+      let arr = []
+      let ids = null
+      this.selectionList.forEach(e => {
+        arr.push(e.id)
+      })
+      ids = arr.join(',')
+      this.$confirm("是否确认解锁?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        unLock({ ids: ids }).then(() => {
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+          this.page.currentPage = 1;
+          this.onLoad(this.page, { parentId: 0 });
+        });
+      })
+
+    },
+    //自定义列保存
+    async saveColumn(ref, option, optionBack, code) {
+      /**
+       * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
+       * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
+       * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
+       */
+      const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
+      if (inSave) {
+        this.$message.success("保存成功");
+        //关闭窗口
+        this.$refs[ref].$refs.dialogColumn.columnBox = false;
+        this.searchReset()
+      }
+    },
+    //自定义列重置
+    async resetColumn(ref, option, optionBack, code) {
+      this[option] = this[optionBack];
+      const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
+      if (inSave) {
+        this.$message.success("重置成功");
+        this.$refs[ref].$refs.dialogColumn.columnBox = false;
+        this.searchReset()
+      }
+    },
+  }
+};
+</script>
+
+<style scoped></style>

+ 9 - 5
src/views/wel/index.vue

@@ -70,6 +70,7 @@ import { areaTypeTree } from "@/api/basicData/customerInformation";
 import xindongPower from "@/views/wel/home/xindongPower/xindongPower.vue";
 import losHome from "@/views/wel/components/losHome.vue";
 import { getLazyList } from "@/api/system/dept";
+import { isProcurement } from "@/api/basicData/configuration";
 export default {
     name: "wel",
     data() {
@@ -77,7 +78,7 @@ export default {
             billType: "",
             saberTenantId: '',
             roler: '',
-            rolerShow:true,
+            rolerShow: true,
         };
     },
     created() {
@@ -92,8 +93,11 @@ export default {
             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)
+        isProcurement({ "param": "lock.term.Days" }).then(res => {
+              localStorage.setItem('lockTermDays', 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 => {
@@ -119,9 +123,9 @@ export default {
 
             let matches = str.match(regex);
             if (matches) {
-                this.rolerShow=false
+                this.rolerShow = false
             } else {
-                this.rolerShow=true
+                this.rolerShow = true
             }
         },
         inPage(url) {