|
@@ -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>
|